Pass Image To Second Page

[Total: 0    Average: 0/5]

This shows how to have a form submit data to another html page that uses javascript to obtain the parmater.

Body Code:

<script>
// this supresses any javascript errors.
onerror=function(){return true;} 
</script>
<!-- 
Specify the action of the form to be this page.
-->
<form name=exf1 action="" method=GET>
<input type=text name=pic value="http://www.js-examples.com/images/blue_ball0.gif">
<input type=submit>
</form>

<HR>
This code could be on the second page that is the action of the above form.<BR>
<script>
_src = unescape(document.location.toString().split("?")[1].split("=")[1]);
document.write("Image = "+_src+"<BR>");
document.write("<img src='"+_src+"' border=1>");
</script>

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *