Join our DNN Community    (Newsletter, Tips, Tricks and Forums for DNN Skins & Modules)

 


 
Microsoft Gold Certified Partner - DNN Benefactor

DotNetNuke Powered! 


Friday, November 21, 2008 Register · Login · Contact · Search:  
Company Solutions Portfolio Contact
Forums
General
The ever-powerful ListX module forum. Post your questions, new configuration ideas and reviews.
Subject: Validation help please

You are not authorized to post a reply.   
Author Messages
adski74
Welterweight
Posts:27

08/28/2008 9:28 AM Alert 
I am having issues with the below validation. I want it to check if the field is empty.Unfortunately even if there is something in the field, the form will not submit & shows the validation error message.

<textarea id="frmSummary" name="frmSummary" cols="75" rows="10" tinymce="true"></textarea><span id="vfrmSummary" controltovalidate="frmSummary" errormessage="*" display="Dynamic" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;display:none;font-weight:bold;">*</span>

<A class=CommandButton onclick="if (typeof(Page_SmartValidate) == 'function') return Page_SmartValidate();" language="javascript" {ACTION,"Add","MWSD_Specials",,Message}>
Save
</A>
AlexK
Cruiserweight
Posts:119

08/28/2008 10:02 AM Alert 
Hi! I pasted your script 'as is' in a ListX module, and it works as expected. Are you sure it's not something else?
adski74
Welterweight
Posts:27

08/28/2008 11:05 AM Alert 
Any ideas what else it could be?

Whats your setup?

I am using listx 1.9.9.9, dnn 4.7 & tinymce 3.1.1

Thanks Alex.
pmanda
Superweight
Posts:267

08/28/2008 9:24 PM Alert 
Did you try adding group to the validation.

<textarea id="frmSummary" name="frmSummary" cols="75" rows="10" tinymce="true"></textarea><span id="vfrmSummary" controltovalidate="frmSummary" group="Summary" errormessage="*" display="Dynamic" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;display:none;font-weight:bold;">*</span>

<A class=CommandButton onclick="if (typeof(Page_SmartValidate) == 'function') return Page_SmartValidate(Summary);" language="javascript" {ACTION,"Add","MWSD_Specials",,Message}>
Save
</A>


Praveena Manda
Software Engineer
Bi4ce,Inc
adski74
Welterweight
Posts:27

08/28/2008 9:59 PM Alert 
I have tried adding grouping as suggested & the validation stopped working. I could submit the form without data.

I have attached the xml a this one has me buggered.. We are testing it on the "add form" in the no results section.

Attachment: without-grouping.xml
Attachment: with-grouping.xml

AlexK
Cruiserweight
Posts:119

08/29/2008 7:29 AM Alert 
Hi Adski,

Yes, I tried grouping the validation. I'll paste "my" code:
<textarea id="frmSummary" name="frmSummary" cols="75" rows="10" tinymce="true"></textarea><span id="vfrmSummary" controltovalidate="frmSummary" errormessage="*" display="Dynamic" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;display:none;font-weight:bold;" group="vGroup">*</span>

<A class="CommandButton" onclick="if (typeof(Page_SmartValidate) == 'function') return Page_SmartValidate('vGroup');" language="javascript" {ACTION,Add,MWSD_Specials,,Message}>
Save
</A>

This works as expected. The only difference might be that I removed the double quotes from within the {ACTION}, and added double quotes to the class=CommandButton statement. I'll try your XML configs ...
AlexK
Cruiserweight
Posts:119

08/29/2008 7:29 AM Alert 
Hi Adski,

Yes, I tried grouping the validation. I'll paste "my" code:
<textarea id="frmSummary" name="frmSummary" cols="75" rows="10" tinymce="true"></textarea><span id="vfrmSummary" controltovalidate="frmSummary" errormessage="*" display="Dynamic" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;display:none;font-weight:bold;" group="vGroup">*</span>

<A class="CommandButton" onclick="if (typeof(Page_SmartValidate) == 'function') return Page_SmartValidate('vGroup');" language="javascript" {ACTION,Add,MWSD_Specials,,Message}>
Save
</A>

This works as expected. The only difference might be that I removed the double quotes from within the {ACTION}, and added double quotes to the class=CommandButton statement. I'll try your XML configs ...
AlexK
Cruiserweight
Posts:119

08/29/2008 7:30 AM Alert 
Wow ... two times! Hurray :-) Sorry 'bout that. Wonder how I did this though.
mikerennick
Middleweight
Posts:55

08/29/2008 7:37 AM Alert 
I have had two problems with validation in the past (like what you describe) and they were as follows:

1. I was using the Listx Toolbar to separate different listx modules on the same page. It is possible to have two fields with the same name, and because they are on the same page validation fails for one and not the other. This is solved by grouping the validation as mentioned above.

2. But, I think that your problem relates to the tinymce editor -- checkout this post:

http://www.bi4ce.com/Support/Forums/tabid/106/view/topic/forumid/7/postid/959/Default.aspx

Mike Rennick
AlexK
Cruiserweight
Posts:119

08/29/2008 7:43 AM Alert 
I changed a few tiny bits and it worked. Try the attached XML config. Single quotes around the group name might have been sufficient (onclick="if (typeof(Page_SmartValidate) == 'function') return Page_SmartValidate('Summary');").

Regards,
- Alex.

Attachment: validated.xml

adski74
Welterweight
Posts:27

08/29/2008 12:41 PM Alert 
Thanks for all your help guys.. I finally got it to work by following the link suggested by mikerennick.

I had to add tinyMCE.triggerSave(); to the save link.

ORIGINAL (NOT WORKING):

<A class=CommandButton onclick="if (typeof(Page_SmartValidate) == 'function') return Page_SmartValidate();" language="javascript" {ACTION,"Add","MWSD_Specials",,Message}>
Save
</A>

WORKING VALIDATION:

<A class=CommandButton onclick="tinyMCE.triggerSave(); if (typeof(Page_SmartValidate) == 'function') return Page_SmartValidate();" language="javascript" {ACTION,"Add","MWSD_Specials",,Message}>
Save
</A>

Thank to Alex for looking into this for us as well - we appreciate it!
You are not authorized to post a reply.
Forums > Bi4ce.Modules.ListX > General > Validation help please



ActiveForums 3.6
Latest Post
 
At R2integrated (formerly Bi4ce), we take support seriously.  That's why we support our customers and DNN community with daily monitoring from our experienced engineering team.  We ask that the first step taken is to read the relevant documentation and support forums prior to submitting any questions that may already be available or have been answered.  We ask that you review the documentation that we provide for our products before posting a question.

The Forums are for our customers to chat, exchange ideas and strategies, and submit feedback.  Please be sure to perform keyword searches for previous related forum responses.

To be helpful when submitting a new item, please include the following: 
  1. DNN Version
  2. Module Version
  3. Admin Log Viewer Information
  4. Environment detail: Operating system, .NET framework version, database and version, IIS version, Browser version (if appropriate)
We always try to respond quickly and monitor the forums daily during business hours (EST).  Occasionally, requests for a specific project requirement may not apply for the free support offered. For project specific support please submit via our Information Request form.

Thank you for using our Forums.

Click here to register for the Forums
 
© 2008 by R2integrated (formerly Bi4ce) | DNN® is a registered trademark of DotNetNuke Corporation