close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Validatio is skipped

Thread began 12/17/2010 12:02 pm by sanj.shah88633 | Last modified 12/20/2010 9:05 am by Ray Borduin | 3028 views | 11 replies |

sanj.shah88633

Validatio is skipped

Hi,

I have a form that I have validation on but the validation is never validated it is skipped:

<form action="<%=MM_editAction%>" method="post" enctype="multipart/form-data" name="form1" id="form1" onSubmit="<%=pau.submitCode()%>;return document.MM_returnValue;WAValidateRQ(document.form1.DocumentReference,'- Document Reference is required',document.form1.DocumentReference,0,false,'text');WAValidateRQ(document.form1.ValidFrom,'- Valid From Date is required',document.form1.ValidFrom,0,false,'text');WAValidateRQ(document.form1.ValidTo,'- Valid To Date is required',document.form1.ValidTo,0,false,'text');WAValidateRQ(document.form1.DocumentType,'- Document Type is required',document.form1.DocumentType,0,true,'select');WAAlertErrors('The following errors were found','Correct invalid entries to continue',true,false,false);return document.MM_returnValue">

Any ideas?

Sign in to reply to this post

Jason ByrnesWebAssist

please send a link where i can see the problem.

Sign in to reply to this post

sanj.shah88633

Is it possible to email the page - by the way I'm using Pure ASP on the this page.

Regards,

Sign in to reply to this post

Ray BorduinWebAssist

Delete the first instance of: "return document.MM_returnValue;" that is causing the validation code to not run.

Sign in to reply to this post
Did this help? Tips are appreciated...

sanj.shah88633

Thanks Ray for your reply, I tried removing the "return document.MM_returnValue;" but still the validation is skipped.

Sign in to reply to this post

Ray BorduinWebAssist

Do you have a sample url? If you look at the javascript errors are there any errors on the page? Please post the code as it looks after you removed that code.

Sign in to reply to this post
Did this help? Tips are appreciated...

sanj.shah88633

I have the error displayed as: 'options' is null or not an object.

and the line highlighted:

function WAFV_GetValueFromInputType(formElement,inputType,trimWhite) {
var value="";
if (inputType == "select") {
if (formElement.selectedIndex != -1 && formElement.options[formElement.selectedIndex].value && formElement.options[formElement.selectedIndex].value != "") {
value = formElement.options[formElement.selectedIndex].value;
}
}

The actual line highlighted is:

if (formElement.selectedIndex != -1 && formElement.options[formElement.selectedIndex].value && formElement.options[formElement.selectedIndex].value != "") {

Thanks,

Sign in to reply to this post

Ray BorduinWebAssist

Do you have a URL where I can view the errors? This sounds like it could be a bad form element name, repeated name, or an empty select list?

Sign in to reply to this post
Did this help? Tips are appreciated...

sanj.shah88633

Ray,

You are correct its to do with the select field, if I remove validation the form validates correctly, at present I have it validating as required:

WAValidateRQ(document.forms[0].DocumentType,'- Document Type is required',document.forms[0].DocumentType,0,true,'select')

How else can I check that the user has selected a value from the select field? I would like to select any option except the first?

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

What did you name the select field? Did it have options in it? Do you have anything else on the page with the same name? It should be possible to validate the select field but it is hard for me to diagnose what was wrong with it without looking at the page.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...