ubuntu ubuntu - 23 days ago 15
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
<input type="text" value ="<?php echo $row[0]; ?>" <?php if(is_numeric($row[0])) echo 'disabled="disabled"'; ?>>
Comments