retain values after submit - Drupal, Php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
weejay
Forum Newbie
Posts: 2
Joined: Thu Nov 18, 2010 3:32 pm

retain values after submit - Drupal, Php

Post by weejay »

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
Neilos
Forum Contributor
Posts: 179
Joined: Fri Nov 19, 2010 2:07 am

Re: retain values after submit - Drupal, Php

Post by Neilos »

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?
weejay
Forum Newbie
Posts: 2
Joined: Thu Nov 18, 2010 3:32 pm

Re: retain values after submit - Drupal, Php

Post by weejay »

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
Post Reply