This is a discussion on InputBox within the ASP and ASP.NET Programming forums, part of the Web Development category; Can we create a InputBox to get input from the user in Java Script? Anybody please help me. Send me ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi Kirubhananth, Hope this code helps. <html> <head> <script type="text/javascript"> var sum function sum(a, b) { var x = parseInt(a) var y = parseInt(b) var z = x+y document.form1.text3.value = z } </script> </head> <body> <form action = "#" id="form1" name="form1"> <table> <tr> <td> <input type="text" id="text1" name="text1"> + <input type="text" id="text2" name="text1"> = <input type="text" id="text3" name="text3"> <td> </tr> <tr> <td> <center><input type="button" id="button1"value="SUM"onclick = "javascript:sum(document.getElementById('text1').v alue, document.getElementById('text2').value)"></center> </td> </tr> </table> </body> </html>
__________________ S.Balasubramanian Nothing is impossible |
| |||
| Hi, Try this also <html> <head> <script type="text/javascript"> function showText() { var e=document.getElementById("text1").value; alert(e); } </script> </head> <body> Name : <input type="text" id="text1" value=""/> <br/> <input type="button" value="Click" onclick="showText()"/> </body> </html> |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/asp-asp-net-programming/5298-inputbox.html | |||
| Posted By | For | Type | Date |
| DiscussWeb IT Community - Technical Support and Technology Discussions | This thread | Refback | 02-23-2008 01:23 AM |