phdphd Posted February 26, 2014 Share Posted February 26, 2014 Hi All, I am trying to find a way to hide the Browse button when the user checks a box. I found the solution when the page has just one pair of browser button/checkbox (http://jsfiddle.net/xSvLc/53/). However since the PHP-generated form is likely to contain multiple browser button/checkbox pairs, I do not know how to implement the JS function in this situation. I tried to (http://jsfiddle.net/xSvLc/58/), but it does not work. Thanks for your help ! PhD Quote Link to comment https://forums.phpfreaks.com/topic/286552-hide-a-browse-button-when-a-specific-box-is-checked/ Share on other sites More sharing options...
Solution kicken Posted February 26, 2014 Solution Share Posted February 26, 2014 What you wrote will work, the problem is that you have jsfiddle configured to wrap your code in an onload event which means your showhide function is no longer available at the global scope. If you either change the fiddle settings or export that function to the global scope then it works fine: - http://jsfiddle.net/xSvLc/59/ Quote Link to comment https://forums.phpfreaks.com/topic/286552-hide-a-browse-button-when-a-specific-box-is-checked/#findComment-1470794 Share on other sites More sharing options...
phdphd Posted February 26, 2014 Author Share Posted February 26, 2014 Thanks Kicken! Quote Link to comment https://forums.phpfreaks.com/topic/286552-hide-a-browse-button-when-a-specific-box-is-checked/#findComment-1470801 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.