![]() | ![]() | ||||||||
| | #1 |
| Active Warrior Join Date: Jan 2011
Posts: 75
Thanks: 0
Thanked 1 Time in 1 Post
|
how do i validate the post form, for example, i want to make sure nobody can submit less then 300 words, no title less than 20 words etc? And also it there a way that i can show the main category on a drop down menu and sun-category on another, instead of on the right side? Thank You! |
| | |
| | |
| | #2 | |
| Javascript Programmer Registered Member Join Date: Feb 2013 Location: London
Posts: 38
Thanks: 35
Thanked 2 Times in 2 Posts
| Quote:
![]() in terms of using jquery something like this would work for counting the characters including spaces: HTML: Code: <input type="text" id="post_body" name="post_body"> <input type="submit" id="check_before_posting" value="Submit"> Code: // on submit click
$("#check_before_posting").click(function() {
// get body value length
body_value = $("#post_body").val.length;
// if less than 300 alert error
if(body_value < 300)
alert("This is not allowed, body less than 300 characters");
}); | |
| | ||
| | |
| | #3 |
| Active Warrior Join Date: Jan 2011
Posts: 75
Thanks: 0
Thanked 1 Time in 1 Post
|
thx very much. but where to put them?
|
| | |
| | |
| | #4 |
| Active Warrior Join Date: Jan 2011
Posts: 75
Thanks: 0
Thanked 1 Time in 1 Post
|
and i am using wordpress
|
| | |
| | |
![]() |
|
| Bookmarks |
| Tags |
| blog, form, post, validation |
| Thread Tools | |
| |
![]() |