Jump to content

IE and onChange script error


NerdConcepts

Recommended Posts

The error says

 

Line: 295
Char: 32
Error: object doesn't support this property or method
Code: 0
URL: xx

 

Here is my code for the select box....

 

<form method="post" name="vehicleselect" id="vehicleselect" class="niceform" style="border: 0; padding: 0; margin: 0;">
<select name="vehicle" id="vehicle" onChange="document.vehicleselect.submit()" class="width_200_height_150">
        <option value="1">Test Vehicle 1</option>
        <option value="2">Test Vehicle 2</option>
        <option value="3">Test Vehicle 3</option>
</select>
<noscript><input type="submit" name="submit" id="submit" value="update"></noscript>
<input type="hidden" name="subVehicleSelect" value="TRUE" />
</form>

 

This just started happening out of the blue. Everything was working perfectly with IE7 and 6 and now the page loads just fine. When I make a selection is when the "Error on page" at the bottom pops up. Firefox is still working fine though. Any clues?

Link to comment
Share on other sites

Ok, I did figure out what I causing this. It is the "Niceforms 1.0" script(s). I am running the fix for it, that enables the Select box onChange to work properly. But the problem is, that doesn't seem to work anymore. I've applied a few different "fixes" for this and nothing seems to fix it. Here is the command that is throwing the error.

 

function selectMe(selectFieldId,linkNo,selectNo) {
//feed selected option to the actual select field
selectField = document.getElementById(selectFieldId);
value = selectField.value;  // FIX CODE
for(var k = 0; k < selectField.options.length; k++) {
	if(k==linkNo) {selectField.options[k].selected = "selected";}
	else {selectField.options[k].selected = "";}
}
//show selected option
textVar = document.getElementById("mySelectText"+selectNo);
var newText = document.createTextNode(selectField.options[linkNo].text);
textVar.replaceChild(newText, textVar.childNodes[0]);
if(value!=selectField.value) {eval(selectField.getAttribute("onChange").replace(/this.value/g, selectField.value));} // FIX CODE
}

 

If I remove the two lines that have "// FIX CODE" after them, no error, but the onchange doesn't do anything. I have no idea what is going on now.

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.