This topic is locked

How to create hidden field

6/15/2011 10:57:44 AM
PHPRunner General questions
I
imthebest author

I want to create a hidden field on the Add page form. This field is part of database table, but I donot want to display it to user. Hence, would like to keep it hidden.

But when data is Added, then I would like to pass a value to this field.
I did not find any option on Visual Editor to hide the field.

I also do not think that if I do not choose the field then I will be able to pass the value to this.
Please advice. How to do this. I am using version 4.2.

C
cgphp 6/16/2011

You could use a custom field: http://xlinesoft.com/phprunner/docs/_view_as__settings_custom.htm
but I'm using PHPrunner 5.3 and I don't know if this feature is supported in PHPrunner 4.2.

I
imthebest author 6/17/2011



You could use a custom field: http://xlinesoft.com/phprunner/docs/_view_as__settings_custom.htm
but I'm using PHPrunner 5.3 and I don't know if this feature is supported in PHPrunner 4.2.


Hello cgphp,
custom field option is also there in phprunner 4.2. But, how we can use that as hidden? The attached link also does not explain how to make that hidden?
Can you please elaborate in much detail, as I could not understand.
Thanks in advance.

C
cgphp 6/17/2011

In the "view as" custom paste this code if the value of the hidden will be the value of the field in the data record:

$value = "<input type=\"hidden\" id=\"my_hidden_field\" name=\"my_hidden_field\" value=\"".$value."\" />";



or this code, if you want to set the hidden to a value of other fields of the same data record:

$value = "<input type=\"hidden\" id=\"my_hidden_field\" name=\"my_hidden_field\" value=\"".$data['other_field_name']."\" />";



In the "edit as" section set the field as readonly.
You have to modify the look and feel of the add page to hide the corresponding hidden field label.