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