473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 5865
acoder
16,027 Expert Mod 8TB
focus() should be lower-case.
May 1 '09 #2

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

Similar topics

5
by: 'bonehead | last post by:
Greetings, I'm still something of a newbie to html/php/mysql. I have a php/html form with several fields of type "input". If the user enters improper data in a particular field and clicks the...
5
by: lawrence | last post by:
How to add text to a textarea using javascript? Apparently this is a popular question, because when I run the search on google, there are a lot of returns: ...
7
by: daniel kaplan | last post by:
hello all, am new to HTML and am in the process of creating a form, no serious headaches, but am stumped on two types of fields. i can take care of these situations using javascript, but was...
0
by: ahres | last post by:
I'm using Stephen Poley's javascript form validation for a relatively simple form, but have encountered a tricky situation wherein the textarea field is frozen in IE5. When clicking in the textarea...
0
by: ED M. | last post by:
Hello all...I'm new to the board. I have a problem that I hope someone here might be able to solve for me. I am doing some clientside validation using Javascript. The text I am testing is...
1
by: tranky | last post by:
Hola boys, i've a question for you! It's possible to highlight some text inside a textarea? (not all text, but a portion!) For example, i've this text inside a textarea. INSERISCI TESTO i...
4
by: Keith Bentrup | last post by:
Hi all, I wrote a simple search function to find text in a textarea where not all the text is visible (ie. the text box displays 10 lines but there may be more than 1000 lines to search). I can...
1
by: deneb | last post by:
Hello everyone, I know this isn't related to generic javascript but I didn't found a group dedicated to the FCKEditor. I'm sorry for the inconvenience. I'm desperately trying to set the focus...
3
AMT India
by: AMT India | last post by:
Hi, I am using FckEditor.It works well.But the problem is that when I insert a "textarea" using source edit,the FCK editor not showing the elements after the textarea.Is this because this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.