Jump to content

Change button disabled through function


IreneLing

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.