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

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.