ubuntu ubuntu - 1 year ago 126
HTML Question

disable if input value is text and enable if it number

I want :
if the value of input is text, then disable.
if the value of the same input is number ,then enable.

the code is

<input type="text" value ="<?php echo $row [0];? disable>

Answer Source
<input type="text" value ="<?php echo $row[0]; ?>" <?php if(is_numeric($row[0])) echo 'disabled="disabled"'; ?>>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download