|
-
Jul 25th, 2005, 09:07 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Dead simple javascript question
How can I return the value from the javascript prompt method to an asp.net textbox control on my form (much in the same way as the thingy on vbforums that prompts you when you want to insert a hyperlink)?
TIA
LMS
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.
Dr. Seuss 
-
Jul 25th, 2005, 10:56 AM
#2
Frenzied Member
Re: Dead simple javascript question
It'll need to be done all client-side. Here is a description of how the prompt function works -> http://www.devguru.com/Technologies/...in_prompt.html.
You could, rather than loading the returned value into the variable y (as in the linked example), load it directly into your TextBox control.
Code:
<script language="JavaScript" type="text/javascript">
function loadvalue() {
window.document.Form1.TextBox1.value = (prompt("Please enter your name.", "Type name here"))
}
</script>
Where Form1 is the ID of your form and TextBox1 is the ID of your TextBox control.
Give me a shout if you have any problems.
DJ
If I have been helpful please rate my post. If I haven't tell me!
-
Jul 25th, 2005, 01:53 PM
#3
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|