ballouta Posted May 2, 2009 Share Posted May 2, 2009 Hello I have a simple html form, one checkbox and one upload (file) control I want to disable the upload control is the checkbox is NOT selected (ticked) please help thank you Link to comment https://forums.phpfreaks.com/topic/156595-disable-upload-with-checkbox/ Share on other sites More sharing options...
Ken2k7 Posted May 2, 2009 Share Posted May 2, 2009 Can you post some HTML please? Link to comment https://forums.phpfreaks.com/topic/156595-disable-upload-with-checkbox/#findComment-824524 Share on other sites More sharing options...
ballouta Posted May 2, 2009 Author Share Posted May 2, 2009 <form id="form1" action="edit_save.php" method="post" enctype="multipart/form-data"> <p dir="ltr"><input type="checkbox" name="replace" value="replace" /> I want to replace the current thumb</p> <p dir="ltr"> <p dir="ltr"> <input name="new_image" id="new_image" size="30" type="file" /></p> </p> <p dir="ltr"><input type="submit" value="Save" name="B1"></p> </form> Link to comment https://forums.phpfreaks.com/topic/156595-disable-upload-with-checkbox/#findComment-824528 Share on other sites More sharing options...
Ken2k7 Posted May 2, 2009 Share Posted May 2, 2009 Add an onclick event to the checkbox. Link to comment https://forums.phpfreaks.com/topic/156595-disable-upload-with-checkbox/#findComment-824530 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.