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
Printable View
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
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.
Where Form1 is the ID of your form and TextBox1 is the ID of 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>
Give me a shout if you have any problems.
DJ
Ta :afrog:
The grey matter thought "Oh no, I've gotta do Javascript" and went into suspend mode. It really was that simple :blush: