Mantis

BBCode and Javascript validation

Posted by ibrahim 
BBCode and Javascript validation
August 11, 2008 04:08PM
Hello, I'm adding a js validation to the bug report page and it's working ok but for the description field (when WYSIWYG is selected).

This is my validation code:
bug_report_advanced_page.php in the FORM tag
onSubmit="return checkform(this)"
And the function looks like:
function checkform(form) {
	var alertmsg = '';
	if (form.summary.value == '&#039winking smiley {
		alertmsg += "- Fill The Summary field\n";
	}
	if (form.description.value.length == 0 || form.description.value == null || form.description.value == "") {
		alertmsg += "- Fill The Description field\n";
	}

        ...
        ...

	if( alertmsg ) {
		alert("Please Check The Following Before Proceed:\n" + alertmsg);
		return false;
	}
}
if I fill the description field and click submit(for the first time) it'll recognize it as not filled
and ask to fill it,but if u click the submit button again it will recognize it correctly...and so on


Any ideas?
Re: BBCode and Javascript validation
August 14, 2008 06:31PM
This editor needs to be updated winking smiley

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Sorry, only registered users may post in this forum.

Click here to login



Online Users

Guests: 12
Record Number of Users: 1 on April 02, 2023
Record Number of Guests: 115 on November 09, 2023
Top Users
Hébergeur : Morinie.Fr