471,887 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

textarea focus while javascript validation using fckeditor

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. {
  4.     var valid=true;
  6.     var location1 = FCKeditorAPI.GetInstance('location_info');    //location_info is name of text area.
  7.     var contents = location1.GetXHTML(true);
  9.         if(!contents)
  10.         {
  11.             alert("Please enter location information");
  12.             location1.Focus();
  13.             var valid=false;
  14.         }
  15.         return valid;
  16. }
May 1 '09 #1
1 5810
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.