Jump to content

FireFox Javascript problem


eddy556

Recommended Posts

Please take a look at the following code, it works as expected in IE but in firefox gives this error:

 

Error: ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper is not defined

Source File: http://localhost:1981/user_area.aspx

Line: 1

 

<div style="vertical-align:top; overflow:hidden;vertical-align:middle; table-layout:fixed;">

                <span id="ctl00_ContentPlaceHolder1_lblCompName">Company Name:</span>
                <div id="ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper" nowrap="nowrap" style="width:auto;display:inline;">
<input name="ctl00$ContentPlaceHolder1$ComboBoxCompany$ComboBoxTextBox" type="text" id="ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox" onkeydown="if(event.keyCode == 9){ScsComboBox_ListBoxDisplaySelectedText(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox,ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox);return false;}" onkeyup="ScsComboBox_TextBoxKeyup(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox,ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox,event)" onmouseover="javascript:if(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox!=_activeComboBoxTextBox) ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';" onmouseout="javascript:if(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox!=_activeComboBoxTextBox) ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';" onfocus="javascript:ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';SetActiveComboBoxTextBox(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox);" onblur="javascript:ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';SetActiveComboBoxTextBox(null);ScsComboBox_TextBoxBlur(this,ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBoxWrapper)" /><img id="ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxPopupImage" onclick="ScsComboBox_ListBoxShow(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper,ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBoxWrapper);" src="/WebResource.axd?d=X2Mjr-4_fQgIerHGoJmLA4beQeL_mfrdmCV81jcoxue0BEu7vgKAFYZC1vKcoczQLOBzEgrPxoh-ptiiioWRcw2&t=633717605465074708" align="absmiddle" style="border-width:0px;" /><div id="ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBoxWrapper" style="position:absolute;visibility:hidden;top:-100px;left:-100px;">
	<select size="5" id="ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox" name="ctl00$ContentPlaceHolder1$ComboBoxCompany" onclick="ScsComboBox_ListBoxDisplaySelectedText(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox,ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox);" onchange="shouldIPostBack()(this);" onkeyup="ScsComboBox_ListBoxKeyup(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox,ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox,event);" onblur="ScsComboBox_ListBoxHide(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBox.offsetParent);javascript:ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';SetActiveComboBoxTextBox(null);" onmouseover="javascript:if(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox!=_activeComboBoxTextBox) ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';" onmouseout="javascript:if(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox!=_activeComboBoxTextBox) ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';" onfocus="javascript:ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox.className='';SetActiveComboBoxTextBox(ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxTextBox);">

		<option selected="selected" value="-1"></option>
		<option value="ABC Ltd">ABC Ltd</option>
		<option value="hello">hello</option>
		<option value="Tirril Brewery">Tirril Brewery</option>

	</select>
</div>
</div>

 

With the following function called on the onclick event:

 

function ScsComboBox_ListBoxShow(txtBxWrapper, lstBxWrapper)
{
    if(lstBxWrapper.style.visibility == "visible")
    {
        ScsComboBox_ListBoxHide(lstBxWrapper);
        return;
    }
    var pos = findPos(txtBxWrapper);
    var top = pos[1];
    var left = pos[0];
    
    lstBxWrapper.style.left = left+1;
    lstBxWrapper.style.top = top+txtBxWrapper.offsetHeight;
    lstBxWrapper.style.visibility = "visible";
    lstBxWrapper.all[0].focus();
    lstBxWrapper.all[0].style.width = txtBxWrapper.offsetWidth;
}

 

I apologies for the formatting of the code, but I am interested in the image tags onclick event:

 

<img id="ctl00_ContentPlaceHolder1_ComboBoxCompany_ComboBoxPopupImage" onclick="ScsComboBox_ListBoxShow(ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper,ctl00_ContentPlaceHolder1_ComboBoxCompany_Wrapper_ListBoxWrapper);"

 

As you can see this fires the above javascript.

Link to comment
Share on other sites

Sorry its is currently all under development and so there is no live server hosting this.  The bug is caused by the output of this control: http://dotnetslackers.com/articles/aspnet/Custom_ASPNET_ComboxBox_Control.aspx

 

I works perfectly in IE, but I know how firefox is on standards etc (not a bad thing).  But no matter what I do I cannot produce a workaround.

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.