I'm trying to create a function which would check too see if a variable was set, and output certain html code if it was, and output some other html code if it wasn't
here's my html code
<select name="country" onChange="checkCountry()"> ........</select>
heres the javascript function
function checkCountry() {
var ctry = document.form1.country[document.form1.country.selectedIndex].value;
if (ctry == "USA") {
document.write(<p><label>State</label><input type=text name=state></p>);
} else {
document.write(<p><label>Country</label><input type=text name=country></p>);
}
}
Thanks!
(is there another easier way to do this using php?)