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

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.