Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey guys this should be a straightforward thing but for some reason it doent work for me
Im updating the image witha new one and when I submit the form to PHP the image reads the default image location not the newly updated one. does someone klnow what I am doing wrong? THANKS IN ADVANCE!

here is the image
HTML
<img id="display_imd" name="display_imd" src="$imagelink2" style="width: 280px; height: 253px;" />


here is my submit button
HTML
<input type="submit" onclick="document.editrecs.submit();" class="btnLogin" name='btnsaveeditrecipe' value="Save Changes" />

here is my script
JavaScript
document.getElementById("display_imd").src=httpRequest.responseText;
Posted
Comments
AspDotNetDev 6-Jan-14 23:48pm    
Are you trying to upload the image when the user clicks the submit button? IMG tags will not be sent to the server on submit. You need an INPUT element of type FILE.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900