469,320 Members | 2,160 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,320 developers. It's quick & easy.

textarea focus while javascript validation using fckeditor

45
Hi everyone,

this is my first time when i am using FCKeditor and i have some problem while doing validation on textareas.
I am checking if that textarea is blank then alert should come for filling the text area and its coming but when i am clicking ok button of alert box it should focus to that text area if i am using focus function but its not focusing to that text area.

what should i do please tell me if anybody knows about this prob.
I am giving code that i am using...

Expand|Select|Wrap|Line Numbers
  1. function form_validate_inclass()
  2. {
  3.  
  4.     var valid=true;
  5.  
  6.     var location1 = FCKeditorAPI.GetInstance('location_info');    //location_info is name of text area.
  7.     var contents = location1.GetXHTML(true);
  8.  
  9.         if(!contents)
  10.         {
  11.             alert("Please enter location information");
  12.             location1.Focus();
  13.             var valid=false;
  14.         }
  15.         return valid;
  16. }
  17.  
May 1 '09 #1
1 5761
acoder
16,027 Expert Mod 8TB
focus() should be lower-case.
May 1 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by 'bonehead | last post: by
5 posts views Thread by lawrence | last post: by
7 posts views Thread by daniel kaplan | last post: by
1 post views Thread by tranky | last post: by
4 posts views Thread by Keith Bentrup | last post: by
1 post views Thread by deneb | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.