Hello,
I have a form in drupal which after the user submits must be stored in a mysql db and the form values must be retained in the form. How do I do that? I have code to store it in DB but not sure how to retain the values. any help is greatly appreciated.
Thanks
retain values after submit - Drupal, Php
Moderator: General Moderators
Re: retain values after submit - Drupal, Php
http://www.w3schools.com/tags/att_input_value.asp
Describes form input types and the 'value' parameter. For type=text you can use value as the default value in the box. Then just use php to drag some info out of the db and plug it in.
Is this the kind of thing you wanted?
Describes form input types and the 'value' parameter. For type=text you can use value as the default value in the box. Then just use php to drag some info out of the db and plug it in.
Is this the kind of thing you wanted?
Re: retain values after submit - Drupal, Php
Hello Neilos,
Thanks for the reply. No that is not what I wanted. What i need is, in the action section of the form I have a php file which does all the db stuff, storing the values in the db. However I also want to retain the values already present in the form. This can be done by giving something like $php_self on the action part of the form. I need both to be done but cant have both in the action part. Thats my question. I even tried checking for $_POST['fieldname'] and assigning the value to the text value. But it doesnt work.
Vijay
Thanks for the reply. No that is not what I wanted. What i need is, in the action section of the form I have a php file which does all the db stuff, storing the values in the db. However I also want to retain the values already present in the form. This can be done by giving something like $php_self on the action part of the form. I need both to be done but cant have both in the action part. Thats my question. I even tried checking for $_POST['fieldname'] and assigning the value to the text value. But it doesnt work.
Vijay