Steve wrote:
Quote:
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.
Quote:
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.
Quote:
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