Hello,
I have a problem with integrating javascript with my image upload PHP script.
I am trying to integrate the following code into my page,
function u(x){
x = document.getElementById(x);
x.disabled = true;
x.value="Uploading.....";
}
The <form> looks like,
<form ENCTYPE="multipart/form-data" method="post" name="form1" action="upload.php" onsubmit="u('b')">
and the submit button looks like,
<input id="b" type="submit" name="submit" value="Upload Image">
As you can see there is nothing wrong with the javascript.
However it doesn't work - i couldn't figure out why untill i noticed that when removing the following lines from upload.php the javascript works,
$submit = isset ($_POST['submit']) ? $_POST['submit'] : NULL;
if ($submit)
I have limited knowledge about PHP scripting however it looks like the upload script (upload.php) does not recognize the submit data after adding the javascript.
Could someone please help me with to solve this problem.
Thank you in advance.
lawina
PS: Server is running PHP 4.4.1