944,119 Members | Top Members by Rank

Ad:
Jun 11th, 2007
0

Recall Form Values script for Check boxes

Expand Post »
I am searching for a script that retains both text and checkbox field values like the script at: www.dynamicdrive.com/dynamicindex16/formremember2.htm
An ASP or Java script would work best.
Thanks.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
danondra is offline Offline
1 posts
since Jun 2007
Mar 17th, 2010
0
Re: Recall Form Values script for Check boxes
Click to Expand / Collapse  Quote originally posted by danondra ...
I am searching for a script that retains both text and checkbox field values like the script at: www.dynamicdrive.com/dynamicindex16/formremember2.htm
An ASP or Java script would work best.
Thanks.
You do it with reading the values back from your database and using "Value" for input boxes, "Selected" for drop down boxes, and "Checked" for check boxes and radio boxes.

Here is a sample of my code I am using on a web site I have designed using PHP. It will be similar in other web design languages.

<select name="Salutation" class="required" id="Salutation" tabindex="1" size="1" style="font-size: 1.6em" /><span id="errmsg"></span>
	<option value=""></option>
	<option value="Mrs." <?php if ($Salutation == 'Mrs.')  echo ' selected="selected"'; ?>>Mrs.</option>
	<option value="Miss" <?php if ($Salutation == 'Miss')  echo ' selected="selected"'; ?>>Miss</option>
	<option value="Ms." <?php if ($Salutation == 'Ms.')  echo ' selected="selected"'; ?>>Ms.</option>
	<option value="Mr." <?php if ($Salutation == 'Mr.')  echo ' selected="selected"'; ?>>Mr.</option>
</select>


<label for="FName">First Name:<span class="red">*</span></label>
<input type="text" id="FName" class="required" name="FName" size="30" maxlength="30" tabindex="2" value="<? echo $FName; ?>" />


<label for="State" id="State">State:<span class="red">*</span></label>
	<select  name="State" size="1" tabindex="6" style="font-size: 1.6em">
	<option value="AR"<?php if ($State == 'AR')  echo ' selected="selected"'; ?>>Arkansas</option>
	<option value="AL"<?php if ($State == 'AL')  echo ' selected="selected"'; ?>>Alabama</option>
	<option value="AK"<?php if ($State == 'AK')  echo ' selected="selected"'; ?>>Alaska</option>
</select>				


<span id="label_credit">Are you taking this course to receive credit?<span class="red">*</span></span>
     <p></p>
	<label for="no">No&nbsp;<input type="radio" name="Credit" id="no" VALUE="N" class="required" onclick="enable_submit()" <?php if (strtoupper($Credit) == 'N')  echo ' checked="checked"'; ?> /></label>
	<label for="yes">Yes&nbsp;<input type="radio" name="Credit" id="yes" VALUE="Y" onclick="enable_submit()" <?php if (strtoupper($Credit) == 'Y')  echo ' checked="checked"'; ?>/></label>

<span id="label_cancel">I will not be able to attend. Please cancel my registration.	<input type="checkbox" name="Cancel" onclick="enable_submit()" value="Y" <?php if (strtoupper($Cancel) == 'Y')  echo 'checked="checked"'; ?>/></span><p></p>
Reputation Points: 10
Solved Threads: 0
Light Poster
Mike_H is offline Offline
27 posts
since Jun 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Configuring Readymade Scripts Forum Timeline: State and City Database
Next Thread in Configuring Readymade Scripts Forum Timeline: if Offline redirect script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC