开发者

Accepting zero as a value

开发者 https://www.devze.com 2023-02-25 20:10 出处:网络
I have a form, and one input is amount. I want to开发者_开发问答 be able to use 0 as a price, but if I use zero, I get an error as set by me that I cannot leave the input blank.

I have a form, and one input is amount. I want to开发者_开发问答 be able to use 0 as a price, but if I use zero, I get an error as set by me that I cannot leave the input blank.

The field is set as int(10).

Thanks


Post your code for validating the field. You may want to use !=='' or isset() instead of empty() or if($_POST[val])


You can use -1 for the default value that represents no amount entry.

0

精彩评论

暂无评论...
验证码 换一张
取 消