469,327 Members | 1,130 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

how to transfer textbox value from .net page to html page textbox?

My question is both .net and javascript and I thought it would be best
posted here.

I have a pop up html page (it just has to be html) with a textbox and a
button next to it. When the user clicks on the button an asp.net page
pops up which allows the user to upload a photo. The asp.net code then
puts the url of this photo into a textbox in the asp.net page. I now
want to be able to press a button and have the value from the asp.net
textbox transferred to the html textbox. Can you please show me how
with example code? I assume the code has to be in javascript?

I hope that's clear. I know you may be thinking why don't I do the
whole thing in .net but the html page has just loads of other things
and javascript on it and I can't really change it.

Thank you.

Feb 3 '06 #1
3 1882
Steve wrote:
My question is both .net and javascript and I thought it would be best
posted here.

I have a pop up html page (it just has to be html) with a textbox and a
button next to it. When the user clicks on the button an asp.net page
Once it leaves the server, it is HTML. ASP .NET is irrelevant after that.

pops up which allows the user to upload a photo. The asp.net code then
puts the url of this photo into a textbox in the asp.net page. I now
want to be able to press a button and have the value from the asp.net
textbox transferred to the html textbox. Can you please show me how
ASP is on the server, I guess you mean in the browser page.
with example code? I assume the code has to be in javascript?


<script type="text/javascript">

function writeText(id, txt)
{
var s;
if ( document.createTextNode
&& document.getElementById
&& (s = document.getElementById(id)) ){
while (s.firstChild) s.removeChild(s.firstChild);
s.appendChild(document.createTextNode(txt));
}
}

</script>

<form action="">
<input type="file" id="fileName">
<input type="button" value="Show file path"
onclick="writeText('thePath', this.form.fileName.value);">
</form>
<div>Here is the filename and path: <span id="thePath"></span></div>
[...]
--
Rob
Feb 3 '06 #2
Thank you for the replies Rob and Lee. I will try out the suggestions.
Thank you for taking the time to point me in the right direction.

Feb 4 '06 #3
Thank you for your help guys, I got that bit to work.

Feb 7 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Nedu N | last post: by
2 posts views Thread by Chris Podmore | last post: by
4 posts views Thread by ewolfman | last post: by
1 post views Thread by colleen1980 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by listenups61195 | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.