JCompo
05-03-2006, 02:50 PM
Hi guys, I'm new to Javascript and am having a problem with the information found in a document value. I am doing code maintenance on the website for our company and am having difficulties debugging this one page. We use a mixture of .asp and javascript.
I have several drop down boxes. OnChange, a function is called to verify that data in previous drop downs are valid. I am just trying to debug it at this moment and alert() me of a drop down's value.
function ResetFields(chgfld) {
if (chgfld == 'Year') {
if (document.frmEditVeh.lstVehTyp.value == 'nada') {
var jason = document.frmEditVeh.1stVehTyp.value;
alert("Please specify this vehicle's type." + jason);
document.frmEditVeh.lstYrModl.value = 'nada';
document.frmEditVeh.lstVehTyp.focus();
} else { ...
I've stuck in there the var jason part so I can see what is in that value but it now crashes when calling that function whether or not the 'nada' valued select option is chosen. If I take out the var jason line and the +jason out of the alert box, it works fine.
Firefox is giving me the following errors concerning this:
ResetFields is not defined <---when something other than 'nada' chosen
ResetFields is not defined <---when 'nada' chosen
missing ; before statement
var jason = document.frmEditVeh.1stVehTyp.value;
*The red 1 is where Firefox points to for the missing ;
I thank you for your time,
Jason
I have several drop down boxes. OnChange, a function is called to verify that data in previous drop downs are valid. I am just trying to debug it at this moment and alert() me of a drop down's value.
function ResetFields(chgfld) {
if (chgfld == 'Year') {
if (document.frmEditVeh.lstVehTyp.value == 'nada') {
var jason = document.frmEditVeh.1stVehTyp.value;
alert("Please specify this vehicle's type." + jason);
document.frmEditVeh.lstYrModl.value = 'nada';
document.frmEditVeh.lstVehTyp.focus();
} else { ...
I've stuck in there the var jason part so I can see what is in that value but it now crashes when calling that function whether or not the 'nada' valued select option is chosen. If I take out the var jason line and the +jason out of the alert box, it works fine.
Firefox is giving me the following errors concerning this:
ResetFields is not defined <---when something other than 'nada' chosen
ResetFields is not defined <---when 'nada' chosen
missing ; before statement
var jason = document.frmEditVeh.1stVehTyp.value;
*The red 1 is where Firefox points to for the missing ;
I thank you for your time,
Jason