zanzibar Posted January 12, 2009 Share Posted January 12, 2009 I'm a not a php programmer, and I have run into a problem. I want a form to retain the data so that the same users don't have to fill it out every single time they to back. I found a great .js for that worked with my html form <input name="first_name" type="text" id="first_name" class="memorize" size="50" maxlength="50" >, but we now have a new php form where we do not uses <input name= ..... etc. We now have two .php doc that looks like this (one is sent to email and the other to a database): <script language="php"> Include ("../shared/contact_data.inc"); CreateTextRow("First Name", "first_name", 3, 56, true); CreateTextRow("Last Name", "last_name", 3, 56, true); and so forth in one doc. and this in another: <script language="php"> Include ("../shared/contact_data.inc"); $information=""; $error=""; $salutation = CheckAndSet ("salutation", "salutation", "Salutation: ", "", FALSE ); $first_name = CheckAndSet ("first_name","first_name", "First Name: ", "You must provide your first name.", TRUE ); Can I use that same .js script by adding some code to either one of those forms? or is there a simple php script that I can use to do the same (recall users form input)? Unfortunately I don't know hardly any php so I would appreciate your help !!! THANKS Link to comment https://forums.phpfreaks.com/topic/140553-how-can-js-recall-form-fields-work-with-new-php-form/ Share on other sites More sharing options...
Psycho Posted January 12, 2009 Share Posted January 12, 2009 There is no way for us to answer your question. This: CreateTextRow("First Name", "first_name", 3, 56, true); appears to be a function that takes 5 parameters and creates a text field. I assume the first parameter is the label, the second is the field name. For the other three I have no idea. It would be best to handle the "persistent" data in PHP. But, you could probably take a look at that function and find a way to add a 6th parameter that would add class="memorize" within the function. Link to comment https://forums.phpfreaks.com/topic/140553-how-can-js-recall-form-fields-work-with-new-php-form/#findComment-735691 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.