PDA

View Full Version : Browse Butto for strings


Keon109
09-26-2005, 06:07 AM
Hello

I want to use a browse button, I know it possible when i use input type file. But i want to pass through the result as a string instead of a file.

Is this possible?

So yes how????

greetings
Koen

birdbrain
09-26-2005, 10:08 AM
Hi Keon109,

welcome to htmlforums. :)

Do you mean like this?
<script type="text/javascript">
<!--
function showFile() {
document.forms[0][1].value=document.forms[0][0].value;
}
//-->
</script>

<form action="http://www.google.com" method="get" onsubmit=" return showFile()">
</div>
<input type="file">
<input type="hidden" name="fileName">
<input type="submit">
</div>
</form>
I use google to test the submission.

Keon109
09-27-2005, 04:41 AM
This is indeed what i need. Thanks

birdbrain
09-27-2005, 05:22 AM
No problem, you're welcome. :)