Jump to content

disable submit button


fareedreg

Recommended Posts

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

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

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.