Dattu
asked on
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.
I have a piece of code that doesn't work in firefox.
ISBNuseSame.Attributes.Add
PPNuseSame.Attributes.Add(
on aspx page, i wrote a function:
function useSame(textBoxId, textBoxValue) {
alert(textBoxValue + textBoxId);textBoxId.value
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.
ASKER
ISBN:
Use Same
PPN:
Use Same
Use Same
PPN:
Use Same
<td>ISBN:</td>
<td><asp:TextBox ID="ISBNTextBox" runat="server" MaxLength="50"></asp:TextBox>
<a href =# ID ="ISBNuseSame" runat = "server">Use Same</a>
</td>
</tr>
<tr>
<td>PPN:</td>
<td><asp:TextBox ID="PPNTextBox" runat="server" MaxLength="20"></asp:TextBox>
<a href = # ID ="PPNuseSame" runat = "server">Use Same</a> </td>
</tr>
ASKER
the error given by firefox is:
Error: missing ; before statement
Source File: http://localhost:4257/Pages/CloneProduct.aspx?productid=68682
Line: 1, Column: 11
Source Code:
javascript:useSame'(ctl00_ ctl00_Page ContentPla ceHolder_M ainContent PlaceHolde r_ISBNText Box , 1);'
Error: missing ; before statement
Source File: http://localhost:4257/Pages/CloneProduct.aspx?productid=68682
Line: 1, Column: 11
Source Code:
javascript:useSame'(ctl00_
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry, what do you mean by adding single quotes inside double quotes. is this right?
ISBNuseSame.Attributes.Add ("onclick" , "javascript:useSame('" + ISBNTextBox.ClientID + "' , '" + isbnValue + "');");
PPNuseSame.Attributes.Add( "onclick", "javascript:useSame('" + PPNTextBox.ClientID + "' , '" + ppnValue + "');");
ISBNuseSame.Attributes.Add
PPNuseSame.Attributes.Add(
ISBNuseSame.Attributes.Add("onclick", "javascript:useSame('" + ISBNTextBox.ClientID + "' , '" + isbnValue + "');");
PPNuseSame.Attributes.Add("onclick", "javascript:useSame('" + PPNTextBox.ClientID + "' , '" + ppnValue + "');");
ASKER
got it. Thank You!
what type of controls are ISBNuseSame and PPNuseSame?
what are ISBNTextBox.ClientID and isbnValue, how are they being set?
does firefox give a javascript error and if so what is it?