-
Sep 29th, 2011, 05:24 AM
#1
[RESOLVED] User input msg validation
Hi guys
I have setup a jQuery way to submit messages by the users. And it works fine. But I want to include a clientside validation on the "msg" being submitted by the user (already coded server side validation).
What I want to validate is, it shouldn't contain any HTML tags or scripts or anything harmful.
Any ideas or code bits ?
Note: I'm very much new to jQuery
If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Oct 27th, 2011, 04:28 PM
#2
Re: User input msg validation
Did you ever get an answer to your problem?
-
Oct 27th, 2011, 09:01 PM
#3
Re: User input msg validation
I found that, there's some premade plugins for jQuery to do the validations. But didn't checked those.
I'm just using the test() method to validate using regex.
Code:
var regex=/^[a-zA-Z]$/;
if(!regex.test($('#username')))
{
//failed. show an error and return
return
}
If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Nov 1st, 2011, 08:23 PM
#4
Re: User input msg validation
Maybe you could do something with John Resig's HTML Parser to check for any HTML in the text?
-
Nov 1st, 2011, 10:02 PM
#5
Re: User input msg validation
Thanks
If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|