开发者

Problem with validating '<' character in input box

Whenever I get the .val() of input box with javascript, everything after and including the < character is not included. So if I put "hello<yo" i receive hello.

So a user typing '<' anywhere in the textbox will either submit a false input he didn't want, or receive the wrong err开发者_如何学Cor message

(i.e. if he inputs "<hello", it will say it's blank)

This seems to be fine in javascript alone. But I am getting the val() from javascript and then in ajax i am sending it to a php URl as a query string and validating it there on the php.

Any ideas?

Thank you.

EDIT: MY bad i didnt know there was a striptag() function being called in php


Instead of entering < try entering &lt;.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜