BoltZ Posted October 25, 2008 Share Posted October 25, 2008 Hi I want to have it so the button is unclickable unless the user presses the checkbox button then it makes it so the button is clickable. Anyone know what i am talking about/ know how to do it? Link to comment https://forums.phpfreaks.com/topic/130107-make-button-nonclickable/ Share on other sites More sharing options...
jwilliam Posted October 25, 2008 Share Posted October 25, 2008 You'll have to use Javascript to achieve this. Buttons have a 'disabled' property, so when you initially load the page print your button like so: <input type="button" id="my_button" disabled="disabled" /> Then, write a JS function to toggle the input's disabled property every time a user clicks the checkbox. I won't write out the full script because I'm about to watch a football game, but you can enable the button in javascript with a line of code like this: document.getElementById('my_button').disabled = false; Link to comment https://forums.phpfreaks.com/topic/130107-make-button-nonclickable/#findComment-674654 Share on other sites More sharing options...
BoltZ Posted October 25, 2008 Author Share Posted October 25, 2008 I know I have to use javascript. That is why I posted in this forum lol. Anyway thx I solved it Link to comment https://forums.phpfreaks.com/topic/130107-make-button-nonclickable/#findComment-674683 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.