Jump to content

[SOLVED] How do you make Radial Dials and Pull Downs sticky


tqla

Recommended Posts

After a form is submitted my Validation looks for errors. When it finds them it redisplays the form. I don't want my users to have to re-input their information so the code in the Text Fields has this as the value "<?php echo @$fieldname ?>" (fieldname replaced with proper field name). This works fine and their input is retained and redisplayed but this seems to work only for text fields, and not for Drop Downs, Radial Buttons, Radial Groups and Check boxes. Is there a way to do this for these too?

 

Thanks.

Link to comment
Share on other sites

I found the answer in a book by David Powers. Here's the jist of it in case anybody needs to know. This sample is a YES or NO dropdown. The $blank_array is the message that appears when a field has no data.

 

             <td align="right"> <p>Interest in speaking with a rep about solving your problem?</p>
            </td>
             <td align="left" valign="top">
		   <select name="interest" id="interest">
               <option value="No Reply"
		   <?php
			if (!$_POST || $_POST['interest'] == 'No reply') { ?>
			selected="selected"
			<?php } ?>			   
		   >Select</option>
               <option value="Yes"
			<?php
			if (isset($blank_array) && $_POST['interest'] == 'Yes') { ?>
			selected="selected"
			<?php } ?>			   
		   >Yes</option>
               <option value="No"
			<?php
			if (isset($blank_array) && $_POST['interest'] == 'No') { ?>
			selected="selected"
			<?php } ?>			   		   
		   >No</option>
               </select></td>

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.