SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: value of textbox
-
Mar 19, 2002, 06:28 #1
- Join Date
- Mar 2002
- Posts
- 38
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
value of textbox
I've got a textbox (within a form) which is blank.
How can I program a button that will make a value appear in the textbox without refreshing the page??
Salvo
-
Mar 19, 2002, 07:57 #2
- Join Date
- Mar 2002
- Location
- Birmingham, UK
- Posts
- 27
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
reply
you dont have to use asp for this, its a simple JavaScript.
:code:
<Script language="JavaScript">
function inputValue(){
var text = "hello world"
document.form.textname.value = text
}
</Script>
<input type="button" value="click me" onClick="inputValue()">
its as simple as that
-
Mar 19, 2002, 13:16 #3
- Join Date
- Mar 2002
- Posts
- 38
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thx Phil
I've translated your code into asp as:
response.write("<INPUT TYPE='button' NAME='button1' VALUE='Click Me' onClick=formname.textboxname.value='" & var & "'>")
Salvo
Bookmarks