Problem with Safari extracting value typed into CuteEditor

Last post 09-09-2009, 3:48 PM by cspacemikeb. 2 replies.
Sort Posts: Previous Next
  •  09-04-2009, 11:39 AM 55377

    Problem with Safari extracting value typed into CuteEditor

    When a user runs Safari, our web app uses javascript to extract the value typed into the CuteEditor, does some validation and posts the data db. The javascript code is invoked when a user clicks Submit.  Our problem is that the code works flawlessly on other browsers (IE7, FF3 (pc and mac), but under Safari an empty value is returned. 
     
    Here is the Javascript we are using:
    -var oOtherAnswer = getTextAnswerObject(oOther.form, "textentry." + id);
    alert(oOtherAnswer.value);  // in Safari, this always returns an empty string.
     
    function getTextAnswerObject(f,s){
       
    for (var i=0;i<f.elements.length;i++){
          el=f.elements[i];
             
    if (!el.tagName.containsIgnoreCase('fieldset')) {
                if (el.name.indexOf(s)>-1){
                   var oCE = document.getElementById("CE_" + el.name + "_ID");
                   
    if (oCE && oCE.getAttribute("_IsCuteEditor")) {
                      
    return oCE;
                   }
    else {
                      return el;
                   }
               }
           }
       }
       
    return null;
    }
     
  •  09-09-2009, 9:09 AM 55479 in reply to 55377

    Re: Problem with Safari extracting value typed into CuteEditor

  •  09-09-2009, 3:48 PM 55494 in reply to 55479

    Re: Problem with Safari extracting value typed into CuteEditor

    Thank you Adam, the solution is to call the getHTML() method, so in my case it is
     
    oOtherAnswer.getHTML() and that grabs the contents of the textarea.  
     
    Really appreciate the help. 
View as RSS news feed in XML