Hello All,
I am experiencing some odd behavior with a form field with a default value.
The form field code is:
<input name=txt_counter type=text maxlength=5 size=5 value='0'>
The $_POST array looks like this:
Array ([submit_button] => 1 [txt_counter] => 0 )
The anomalous code and results are as follows:
if (strlen($POST['txt_counter'] == 0)) $error=TRUE;
echo ('error: ' . $error); //displays 1
echo ('len : ' . strlen($POST['txt_counter'])); //displays 1
if (!is_numeric($_POST['txt_counter'])) $error=TRUE;
echo ('error: ' . $error); //displays 1
I must need a new pair of eyes! What am I missing???