I have a form and at the bottom it asks if you want a shirt? it gives you a yes and a no radio button to choose.

If the user selects yes I want a jump menu to display with shirt sizes, if they select no I want it to disappear.
How would I do that?

Include Shirt: <br/>
Yes:<input type="radio" name="shirt" value="shirt_yes"/>
 No:<input type="radio" name="shirt" value="shirt_no"/>
<br/>
Size:
<select name="size" id="size" onChange="MM_jumpMenu('parent',this,0)">
  <option>medium</option>
  <option>large</option>
  <option>XL</option>
  <option>XXL</option>
</select>
<br/>
<input type="submit" value="Submit order" />
<br />
</form>

Now if that is going to require something like ajax or javascript, which I cannot code. If there a way in my submit php script to determine the different and post the size if they selected yes to the email order form?

Thanks

Recommended Answers

All 2 Replies

<script type="text/javascript">
function jfunc(x){

if(x=="shirt_yes"){
document.getElementById("jdiv").style.display="block";
}else{
document.getElementById("jdiv").style.display="none";
}

}
</script>
Include Shirt: <br/>
Yes:<input type="radio" name="shirt" onclick="jfunc(this.value)" value="shirt_yes"/>
 No:<input type="radio" name="shirt" onclick="jfunc(this.value)" value="shirt_no"/>
<br/>
<div id="jdiv" style="display:none;">
Size:
<select name="size" id="size" onChange="MM_jumpMenu('parent',this,0)">
  <option>medium</option>
  <option>large</option>
  <option>XL</option>
  <option>XXL</option>
</select>
<br/>
<input type="submit" value="Submit order" />
<br />
</div>
</form>

gee that works amazing! thanks!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.