IreneLing Posted October 10, 2011 Share Posted October 10, 2011 Hi all , here is a question about a disabled button . If I have a button: <input id='submit' type='submit' disabled='disabled' value='submit'> Is it possible to change the "disabled=true" through php function ? such as function change_button(){ echo "<script language=\"javascript\">"; echo "document.getElementById('submit').disabled=true;"; echo "</script>"; } I tried it , not working...is this function possible or have I make any mistake ? Thanks for every reply . Link to comment https://forums.phpfreaks.com/topic/248846-change-button-disabled-through-function/ Share on other sites More sharing options...
requinix Posted October 10, 2011 Share Posted October 10, 2011 Not through PHP. You can only change it through JavaScript. Link to comment https://forums.phpfreaks.com/topic/248846-change-button-disabled-through-function/#findComment-1277939 Share on other sites More sharing options...
IreneLing Posted October 10, 2011 Author Share Posted October 10, 2011 Thanks for your reply , I got it now , and I just found a better way to do it , really thanks . Link to comment https://forums.phpfreaks.com/topic/248846-change-button-disabled-through-function/#findComment-1277965 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.