javascript problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i placed an html button on a C# asp.net webform and placed the following html
code in the html/aspx file:

<TD style="WIDTH: 147px"><INPUT onclick="history.go(1)" type="button"
value="Go Back"></TD>

but now i have to use a variable instead of "1" bec. the no. of pages to go
back to is computed on the server side. i placed a textbox in the webform to
hold the value. so here's what i got so far:

<TD style="WIDTH: 147px"><INPUT
onclick="history.go(document.Form1.txtRowCount.value)" type="button"
value="Go Back and make changes"></TD>

but when the button is clicked, nothing happened. pls. help and thanks in
advance.
 
try:

onclick="history.go('" + document.Form1.txtRowCount.value +"' )" type="button"
value="Go Back and make changes"></TD>

so thats single quote, double quote, plus, your variable , plus, double
quote, single quote

cheers CR
 
i tried it but now i'm getting an error.

CodeRazor said:
try:



so thats single quote, double quote, plus, your variable , plus, double
quote, single quote

cheers CR
 
Back
Top