Jump to content

populate field based on flag value...


rsammy

Recommended Posts

i am working on a php page where i need to populate a field (<tr></tr> tags) based on the flag value of another field.

 

i have a field:

 

Do you own a car? The input is the result from a radio button (Yes/No). If No, do nothing.  But if user chooses, Yes, then I am setting a flag ($carFlag) to true.

 

<tr>
<td width="30%" height="40" valign="top">
 Do you own a car?
</td>
  	<td valign="top">
  		Yes <input type="radio" name="car" id="car" value="Yes" <?php echo (($car=='Yes')?"checked":""); $carflag=='True';?>>   No <input type="radio" name="car" id="car" value="No" <?php echo (($car=='No')?"checked":"");?>> <a href="" onclick="javascript:return popup()"><span style="font-size:10px;">What is it?</span></a>
  	</td><br>
</tr>

 

if car flag is true, then the another field, 'make and model' should be displayed for user to enter information.l How do I do this?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/159295-populate-field-based-on-flag-value/
Share on other sites

thanks much for your reply. it hides the field but, does not populate when i choose 'yes' as the option for the question: Do you own a car?

 

Is it because PHP will only show this up when we do a POST? should i use javascript instead? if yes, can you or someone here please help me out?

 

thanks again...

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.