I want to run this code on ONCHANGE event

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

I want to run this code on ONCHANGE event

Post 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
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post 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.
Post Reply