I have a basic web page with an HTML5 SELECT object that has 3 elements populated in it via js/jQuery. I want to take the value selected, and pass the value to a js file that runs a perl script.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js" charset="utf-8"></script>
<script type="text/javascript" src="js/main.js" charset="utf-8"></script>
<script type="text/javascript" src="js/RunPerlScript.js" charset="utf-8"></script>
</head>
<body>
<header>
<h1></h1>
</header>
<form name="myForm" method="GET" action="">
<select id="cdLDAP" onchange="run_script_func(this.textvar
<option/>
</select>
</form>
</body>
</html>
JS File:
var selection = #cdLDAP.text
function run_script_func(val){
window.alert=val;
}
Based on my PHP admin console I know the script isn’t executing. My Perl script does work as expected, if I run it by itself, so I know it is not that aspect of my code.
Am I using the onchage="" element correctly? and/or is it how the RunPerlScript.js file is structured?
Got the message box to work. The message box was being used to test the script was being called
onchangeAnd this is the JS File: