fareedreg Posted January 16, 2010 Share Posted January 16, 2010 how to make submit button disable..in php.. I am tryting to find record from table.. like this include('connect.php'); $Tb = "ret"; mysql_select_db($Db, $link); $query="select * from $Tb where issue_id=$val"; $result= mysql_query($query,$link) or die("Could not able to connect with return table"); $fel=mysql_num_fields($result); $nro=mysql_num_rows($result); if($nro>0) { disable submit button(how to) } submit buttton define belowin html like this <table width="129" border="0" align="center"> <tr> <td width="66"><input name="cmdsubmit" type="submit" id="cmdsubmit" value="Submit" disabled="true"/></td> <td width="53"><input type="reset" name="cmdclear" id="cmdclear" value="Clear" /></td> </tr> </table> } Link to comment https://forums.phpfreaks.com/topic/188662-disable-submit-button/ Share on other sites More sharing options...
Buddski Posted January 16, 2010 Share Posted January 16, 2010 include('connect.php'); $Tb = "ret"; mysql_select_db($Db, $link); $query="select * from $Tb where issue_id=$val"; $result= mysql_query($query,$link) or die("Could not able to connect with return table"); $fel=mysql_num_fields($result); $nro=mysql_num_rows($result); $disabled = ($nro > 0 ? 'disabled="disabled"' : ''); <table width="129" border="0" align="center"> <tr> <td width="66"><input name="cmdsubmit" type="submit" id="cmdsubmit" value="Submit" <?php echo $disabled; ?> /></td> <td width="53"><input type="reset" name="cmdclear" id="cmdclear" value="Clear" /></td> </tr> </table> Theres an idea for you Link to comment https://forums.phpfreaks.com/topic/188662-disable-submit-button/#findComment-995998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.