IT Community - Software Programming, Web Development and Technical Support

InputBox

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 ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 02-20-2008, 04:18 AM
Kirubhananth Kirubhananth is offline
D-Web Programmer
 
Join Date: Feb 2008
Location: My native is Madurai but now in Chennai
Posts: 61
Kirubhananth is on a distinguished road
Send a message via AIM to Kirubhananth Send a message via Skype™ to Kirubhananth
Question InputBox

Can we create a InputBox to get input from the user in Java Script?
Anybody please help me.
Send me code example.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-22-2008, 01:15 AM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: InputBox

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-22-2008, 10:16 PM
poornima poornima is offline
D-Web Sr.Programmer
 
Join Date: Dec 2007
Posts: 189
poornima is on a distinguished road
Smile Re: InputBox

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>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -7. The time now is 07:33 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0