textarea focus while javascript validation using fckeditor

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tokcy
    New Member
    • Sep 2008
    • 45

    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...

    Code:
    function form_validate_inclass()
    {
    	
    	var valid=true;
    
    	var location1 = FCKeditorAPI.GetInstance('location_info');    //location_info is name of text area.
    	var contents = location1.GetXHTML(true);
    	
            if(!contents)
    		{
    			alert("Please enter location information");
    			location1.Focus();
    			var valid=false;
    		}
            return valid;
    }
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    focus() should be lower-case.

    Comment

    Working...