Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 20th Feb 2013, 05:13 AM   #1
HyperActive Warrior
 
Join Date: 2011
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Default
Post Blog Form Validation
Share on: 
fb share twitter share gplus share more share

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  
Unread 20th Feb 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
Share on: 
fb share twitter share gplus share more share

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  
Unread 22nd Feb 2013, 06:47 AM   #3
HyperActive Warrior
 
Join Date: 2011
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: Post Blog Form Validation
Share on: 
fb share twitter share gplus share more share

thx very much. but where to put them?

bestseoexpert is offline  
Unread 22nd Feb 2013, 06:48 AM   #4
HyperActive Warrior
 
Join Date: 2011
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: Post Blog Form Validation
Share on: 
fb share twitter share gplus share more share

and i am using wordpress

bestseoexpert is offline  
Closed Thread


Bookmarks

Tags
blog, form, post, validation


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 04:50 AM.