new to asp.net simple question plz help me
-
hi my aim is to ask user to input a number and square it then want to display it in another text box ..with out postback of the page i have used a html button n tried but failed plz do let me know regards sindhu tiwari
Merry Xmas
-
hi my aim is to ask user to input a number and square it then want to display it in another text box ..with out postback of the page i have used a html button n tried but failed plz do let me know regards sindhu tiwari
Merry Xmas
<html > <body> <script language="javascript"> function Square() { var tb1 = window.document.getElementById("tb1"); var tb2 = window.document.getElementById("tb2"); tb2.value = ""; if(tb1.value == "" || isNaN(tb1.value)) return; var temp = parseInt(tb1.value); tb2.value = temp * temp; } </script> <input type="text" id="tb1" name="tb1" /> <br /> <input type="text" id="tb2" name="tb2" /> <br /> <input type="button" value="Square" onclick="Square();"/> </body> </html>
-
hi my aim is to ask user to input a number and square it then want to display it in another text box ..with out postback of the page i have used a html button n tried but failed plz do let me know regards sindhu tiwari
Merry Xmas
Hi Sindhu! Try this Javascript.
function SQRT() { var value=Form1.inputText1.value; value = value * value; Form1.inputText2.innerText = value; }
Regards."If I were not myself, I would like to be somebody like myself." :)