Jump to content

onchange help


dare87

Recommended Posts

I've been working on getting a form that will change a portion of the content of the page depending on what you select. I have it working if I just have it display text, but if I change it the whole thing stops working.

 

Please Select the Registration form you would like to complete
<form name="registration">
<select name="select" onChange="displaydesc(document.registration.select, theform, 'showform')">
	<option selected value="">Select One</option>
	<option value="">Basketball Tournament</option>
	<option value="">Rock Band Tournament</option>
	<option value="">Foot Race</option>
	<option value="">Booths</option>
</select>
<br><br>
<span id="showform" align="left" style="font:italic 13px Arial"></span>
</form>

<script type="text/javascript">
var theform=new Array()
theform[0]=""
theform[1]="<?php echo 'auxiliary/bball.php'; ?>"
theform[2]="<?php echo 'auxiliary/rband.php'; ?>"
theform[3]="<?php echo 'auxiliary/frace.php'; ?>"
theform[4]="<?php echo 'auxiliary/booth.php'; ?>"


function displaydesc(which, descriptionarray, container){
if (document.getElementById)
document.getElementById(container).innerHTML=descriptionarray[which.selectedIndex]
}


displaydesc(document.registration.select, theform, 'showform')

</script>

 

I've tried changin echo to an include('page.php'), but it just kills it. Please help, I need this to work ASAP

Link to comment
https://forums.phpfreaks.com/topic/190082-onchange-help/
Share on other sites

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.