Freelancer.com

Go Back   Warrior Forum - The #1 Internet Marketing Forum & Marketplace > Warrior Support Forums > Programming
Register Blogs Social Groups Advertise with usHelp Desk

Reply
LinkBack Thread Tools
Unread 20th February 2013, 05:13 AM   #1
HyperActive Warrior
 
Join Date: 2011
Posts: 100
Thanks: 0
Thanked 1 Time in 1 Post
Default Post Blog Form Validation

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!

bestseoexpert is offline   Reply With Quote
Unread 20th February 2013, 06:43 AM   #2
Javascript Programmer
Registered Member
 
nodesolomon's Avatar
 
Join Date: 2013
Location: London
Posts: 38
Thanks: 35
Thanked 2 Times in 2 Posts
Default Re: Post Blog Form Validation

Quote:
Originally Posted by bestseoexpert View 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!
you can either validate using javascript(jquery) instantly on the webpage, or if your using a server side language i.e. php you would have to refresh the page and then show the error(very annoying)

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">
Javascript(JQUERY) :

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");
});

read my collection of Famous Quotes
Free Online Movies
nodesolomon is offline   Reply With Quote
Unread 22nd February 2013, 06:47 AM   #3
HyperActive Warrior
 
Join Date: 2011
Posts: 100
Thanks: 0
Thanked 1 Time in 1 Post
Default Re: Post Blog Form Validation

thx very much. but where to put them?

bestseoexpert is offline   Reply With Quote
Unread 22nd February 2013, 06:48 AM   #4
HyperActive Warrior
 
Join Date: 2011
Posts: 100
Thanks: 0
Thanked 1 Time in 1 Post
Default Re: Post Blog Form Validation

and i am using wordpress

bestseoexpert is offline   Reply With Quote
Reply

  Warrior Forum - The #1 Internet Marketing Forum & Marketplace > Warrior Support Forums > Programming

Bookmarks

Tags
blog, form, post, validation

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 06:27 AM.