htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: WYSIWYG Forums: WYSIWYG Editor Discussion:
Problem With Editor and Other Scripts


 


dtfhome
New User

Mar 13, 2005, 7:11 AM

Post #1 of 4 (87700 views)
Shortcut
Problem With Editor and Other Scripts Can't Post

I am trying to make use of the html area editor and followed the instructions to test it our on my form.

I was able to get it working but have encountered a slight problem. I have another script on the page that is set to display a simple alert if the element in the form is left blank and it worked fine until I installed the script for the editor.

Now, when I have a text area that uses the area, it displays the alert but when the user clicks "ok", it still continues to submit the form. Without the editor, it does not submit the form unless the criteria, not blank, is met.

Any help would be greatly appreciated. Thanks in advance. Here is the code I am using to call the html editor and my javascript code for requiring the form field. Again, they seem to work independently but not together.

<script type="text/javascript">
_editor_url = "/HTMLArea/";
_editor_lang = "en";
</script>
<script type="text/javascript" src="/HTMLArea/htmlarea.js"></script><script language="javascript">
function checkform()
{
if (AddNewThread.threaddetails.value == "")
{alert('Please Enter Details.');}
return false;
}

</script>

<script type="text/javascript" defer="1">

var config = new HTMLArea.Config();
config.toolbar = [
['fontname', 'space',
'fontsize', 'space',
'formatblock', 'space',
'bold', 'italic', 'underline']
];
HTMLArea.replace('ta', config);

</script>


odtufatih
New User

Mar 24, 2005, 3:38 AM

Post #2 of 4 (87488 views)
Shortcut
Re: [dtfhome] Problem With Editor and Other Scripts [In reply to] Can't Post

   

So are you checking the variable for not being empty with the action onSubmit(on the form tag) or onClick(on the submit tag) when the form submits..Try changing it..The same was happening to me and i just changed my form from onSubmit to onClick behaviour..


rojen
New User

Jan 12, 2006, 10:33 PM

Post #3 of 4 (86665 views)
Shortcut
Re: [odtufatih] Problem With Editor and Other Scripts [In reply to] Can't Post

I have same problem like dtfhome's and when i try to submit the form using onclick behavior, it doesn't submit the value of textarea(htmlarea) only. So, still having problem.

Any idea on this issue.

Thank You


(This post was edited by rojen on Jan 12, 2006, 10:53 PM)


mklangeman
New User

Jan 27, 2006, 12:30 PM

Post #4 of 4 (86516 views)
Shortcut
Re: [rojen] Problem With Editor and Other Scripts [In reply to] Can't Post

Hey. I just ran into a similar problem today. My form was still being submitted even when it wasn't valid. I would even get javascript popups saying a field wasn't valid, but it would submit anyway. So I stumbled across a bit of a weird solution. Not sure why it works, but...

I used to have something like


Code
verifyForm() { 
if (blah)
return false;
if (blahblah)
return false;

document.frm.submit()
}


and then


Code
onclick="javascript:verifyForm();”



Now I have


Code
verifyForm() { 
if(blah) {
return false;
} else if(blahblah) {
return false;
} else {
document.frm.submit()
}
}

and then


Code
onclick=”return verifyForm();”



So I made 2 changes... the if/else structure in the function, and return instead of javascript: for onclick

As I said, I'm not sure why this worked. But is seems to fix my problem.

 
 
 


Search for (options)