Jump to content

how can js. "recall form fields" work with new php form?


zanzibar

Recommended Posts

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 :)

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.