Question : javascript working in IE but not in Firefox asp.net

Hi,
I have a piece of code that doesn't work in firefox.
ISBNuseSame.Attributes.Add("onclick", "javascript:useSame(" + ISBNTextBox.ClientID + " , " + isbnValue + ");");

PPNuseSame.Attributes.Add("onclick", "javascript:useSame(" + PPNTextBox.ClientID + " , " + ppnValue + " );");

 on aspx page, i wrote a function:
 function useSame(textBoxId, textBoxValue) {
            alert(textBoxValue + textBoxId);textBoxId.value = textBoxValue;
          textBoxId.value = textBoxValue;            
        }
on ie, it works fine, on firefox, even the alert does not fire. Also, can you please tell me how do I five the textboxvalue to that textbox.

Answer : javascript working in IE but not in Firefox asp.net

More than likely one or both of the values need to be in quotes for javascript:

ISBNuseSame.Attributes.Add("onclick", "javascript:useSame('" + ISBNTextBox.ClientID + "' , "' + isbnValue + "');");

Add single quotes inside double quotes where needed for string values.
Random Solutions  
 
programming4us programming4us