Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Closed Thread
An event handler isn't firing
Old 09-03-2008, 06:00 PM An event handler isn't firing
Average Talker

Posts: 19
Name: Meir Ech
Trades: 0
Here's the HTML/PHP file, and below this is the javascript file.
My trigger2 isn't firing.

Code:
<html>
<head>
<script src='js/test.js' type='text/javascript'></script>
</head><body>
<?php
include_once "configHPP.php";				
echo '<h2>How Much Education Have You Acquired, GENIUS?</h2>';
echo '<form action="'.htmlspecialchars($_SERVER['PHP_SELF']).'" method="post">';
if (!isset($_POST['go']))  {
	echo "<select id='education' name='education'>";
	echo "<option value='Jr.High'>Jr.High</option>";
	echo "<option value='HighSchool'>HighSchool</option>";
	echo "<option value='College'>College</option></select>";
}  else  {
	if (isset($_POST['education'])) {
		if ($_POST['education'] == "College") {
			echo "<label>College name: </label><input id='org' type='text' size='30' /><br />";
			echo "<label>Zip code: </label><input type='text' size='10' /><br />";
		} else {
			exit("Not bright - are you?");
		}
	}
}
 ?>
<input id="submitbutton" name="go" type="submit" value=" Submit " />
</form></body></html>
javascript file:

Code:
function shout(msg)  { 
	alert(msg);
}

function setTrigger1()  {
	var picklist = document.getElementById("education");
	picklist.onchange = function() {
		if (picklist.value != "")  {
			shout("OPTION changed"); 
		}
	}
}

function setTrigger2()  {
    var org = document.getElementById("org");
 	org.onchange = function() {
 		shout("College Name CHANGED");
	}  
}

window.onload = function() {
	setTrigger1();
	setTrigger2();
}
Thanks for your help!
ruffy is offline
View Public Profile
 
 
Register now for full access!
Closed Thread     « Reply to An event handler isn't firing
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09151 seconds with 12 queries