I'm with CK on this one - definitely use server-side ClientID to
populate the actual variable names instead of hard-wiring the funky
syntax (ctl00$ContentPlaceHolder1$drpType).  Once you do that, it will
be significantly easier to debug.

One possibility, can't tell if this is true for you or not, but
FireFox is case-sensitive with its items, while IE is not.  If your
hard-wiring of the ID is mis-cased, then it will work in IE but not
FireFox.  If that's the case, then using the ClientID property will
solve your problem for you.  If not, you can view source and strip
down the HTML into the bare minimum for your events, and see what that
looks like.

A couple of suggestions: The "Javascript: " syntax is not really
appropriate - event handlers don't need it, and even though browsers
accept it, it seems to be general practice not to use it.  The
exception is when you're doing it inside a link, like <a
href="javascript: doSomething();">ClickMe</a>.  Also, "onChange"
really should be "onchange" - the browser is still pretty forgiving,
but the actual property of the item is lower case, and when used in
javascript it must be cased correctly - so in my opinion it's good
practice to always use the fully lower-case version.  Neither of these
will affect your outcome, but just my two cents...

On Oct 4, 10:26 am, JaffaB <[EMAIL PROTECTED]> wrote:
> All,
>
> I have an ASP.NET application which works 100% in Internet Explorer,
> but has a fault when run in FireFox.   On one form, I have a drop down
> control which when a value is set, makes a command box visible.  When
> the drop down is used in Internet Explorer, the button appears but in
> Firefox, the command box stays invisible.   The coding for this
> control is done in the ASPX java code as follows:
>
> At the start of the code, I set the attributes on the drop down to
> call the show commands as follows:
>
> drpType.Attributes.Add("onChange",
> "JavaScript:ShowButtonsOnConnection();")
>
> Then we have the main command to make the button visible and change
> the button text as follows:
>
> function ShowButtonsOnConnection()
> {
> try{
> if
> (document.getElementById('ctl00$ContentPlaceHolder1$drpType').value=='Null')
> {document.getElementById('ctl00_ContentPlaceHolder1_btnConType').style.visibility='hidden';}
>
> else if
> (document.getElementById('ctl00$ContentPlaceHolder1$drpType').value=='O')
> {document.getElementById('ctl00_ContentPlaceHolder1_btnConType').style.visibility='visible';
> document.getElementById('ctl00_ContentPlaceHolder1_btnConType').value='ODBC
> Admin';}
>
> }
>
> catch(response)
> {
>
> }
> }
>
> Can anybody suggest how I get this to function in Firefox?
>
> Thanks
>
> Jaffa

Reply via email to