A directory of browser-based WYSIWYG editors


Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
onsubmit should return true or false

The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.


New User

Jan 4, 2005, 8:51 PM

Post #1 of 1 (2421 views)
onsubmit should return true or false Can't Post

here's my modification to the newest htmlarea.js in cvs

 f.onsubmit = function() { 
editor._textArea.value = editor.getHTML();
var a = this.__msh_prevOnSubmit;
// call previous submit methods if they were there.
if (typeof a != "undefined") {
for (var i = a.length; --i >= 0;) {
- a{i}();
+ if (!a{i}()) return false;
+ return true;

web developer may choose to cancel submitting because client-side javascript detects invalid inputs, etc...
the implementation can be different, say like when a{i} (I don't know how to express that in ubb...) returns false, we continue with the next a{i} but return false at the end, etc... but basically we want to be able to do this. same rule might apply to onreset event too...


Search for (options)