...

View Full Version : drop down menu that opens div with 2 radio buttons



johnwboyd
03-17-2009, 01:06 AM
How would I go about coding this? If they select No the div with the radios would open and be required.

http://www.shoppingcartcash.com/

http://www.shoppingcartcash.com/form.js

jmrker
03-17-2009, 02:56 AM
Try this ...

Keep in mind that all ID='values' must be unique.
Can not have, for example, two id='FieldData7' entries in the same script.

Should not break <TABLE> rows using <DIV>.
That's why I split the table display just before the hidden content.
Keep whole table within the <DIV> tags.



<td>

<select name="FieldData7select" id="FieldData7select"
onchange="NoDataAccesDisplay(this.value)">

<option value="">Select</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>

</td>
</tr>
</table>

<div id="NoDataAccess" style="display="none">
<table border="0">
<tr>
<td>

<br> <br>
<span class="style3">If no, are you willing to pay a low cost developer if needed in order to switch to an open source cart where <em>you</em> manage the source code and customer database in order to save on monthly fees, get faster hosting in most cases, and get paid a guaranteed $1 per U.S. and Canada transaction?</span> (We can consult you for free on this.)<br>

.....

</tr>
</table>
</div>


In the <HEAD> of the HTML add:


<script type="text/javascript">
function NoDataAccessDisplay(choice) {
if (choice == 'No') {
document.getElementById('NoDataAccess').style.display = 'block';
} else [
document.getElementById('NoDataAccess').style.display = 'none';
}
}
</script>

Note 1. -- should remove ALL html in external .JS file (remove <!-- -->, etc)
Note 2. -- script not tested

johnwboyd
03-18-2009, 10:32 AM
Thanks but it doesn't work. Error messages in IE and div still showing in both browsers. Also I wanted to have 2 radio dial buttons within the div and the field names are FieldData7, FieldData8 respectively. I tried using FieldData7B before and the php had an error.

jmrker
03-18-2009, 02:40 PM
Thanks but it doesn't work. Error messages in IE and div still showing in both browsers. Also I wanted to have 2 radio dial buttons within the div and the field names are FieldData7, FieldData8 respectively. I tried using FieldData7B before and the php had an error.

You either did not change or update the link to your program in the earlier post so I am seeing the same errors as before. Same problem with non-unique IDs etc.

Just saying "Thanks but it doesn't work." is not much help.
If you make changes how we know that that error is not elsewhere?
If you want help, you need to help us.

johnwboyd
03-27-2009, 02:55 PM
I am not seeing any errors as of now in IE.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum