Ticket #33 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

about form submit

Reported by: forgottentowers Owned by: gogo
Priority: high Milestone:
Component: Xinha Core Version:
Severity: major Keywords:
Cc:

Description

Hi there I try to check values in a form with a Xihna textara, but I tried form onSubmit and didn??t work, "return false" was skipped and the form redirect to the "action" page. I tried then a only button with a script, it worked, but when ran form1.submit() the content of the Xihna textarea didn??t pass to "action page". How can I check values before submit a form with a Xinha textarea? thanks

Change History

Changed 8 years ago by forgottentowers

I think the problem is here: htmltextarea (line 640), thanks

if (textarea.form) {

// we have a form, on submit get the HTMLArea content and // update original textarea. var f = textarea.form; if (typeof f.onsubmit == "function") {

var funcref = f.onsubmit; if (typeof f.msh_prevOnSubmit == "undefined") {

f.msh_prevOnSubmit = [];

} f.msh_prevOnSubmit.push(funcref);

} 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 in a) {

a[i]();

}

}

};

}

Changed 8 years ago by gogo

  • status changed from new to closed
  • resolution set to fixed

This problem is fixed in changeset:27 - you may now return false from the onsubmit of a form to stop the form from submitting.

Note: See TracTickets for help on using tickets.