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.

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>

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.