Page 1 of 1

I want to run this code on ONCHANGE event

Posted: Wed Dec 13, 2006 1:47 am
by eshban
Hello i have a little PHP code. The code give output(returns complete path of file) when user press "SUBMIT" button. I want to run this code on 'ONCHANGE' event of the 'BROWSE' button. means when user press the browse button, then instead of pressing submit button, the code returns the desired result. Plz help me in modifying this code, so that it gives output on 'ONCHANGE' event

Code: Select all

<?
print "PATH = ".$_REQUEST['path'];
?>

Code: Select all


<form name="viewPage" method="post" enctype="multipart/form-data" onSubmit="this.path.value = this.myfile.value;" action="complete_path.php?submit=yes">
	
<input type="hidden" name="path">
<input type="file" name="myfile">

<input type="submit" name="aaa">
</form>
Please help

Posted: Wed Dec 13, 2006 2:06 am
by Zoxive
I think you don't understand that PHP is a server side language, In order to what I think you are saying you need Javascript
+ XML aka Ajax.