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

 


 
Microsoft Gold Certified Partner - DNN Benefactor

DotNetNuke Powered! 


Monday, December 01, 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: Limit total inputs on submit

You are not authorized to post a reply.   
Author Messages
jepper
Superweight
Posts:216

10/02/2008 10:51 AM Alert 
I am wanting to limit the quantities input on a form I have populated from the database. Each input box is named frmQty[ItemID], this allows me to insert all the inputs into another table. Thanks to pauldes this works like a charm.

http://dnn.bi4ce.com/Support/Forums/tabid/106/forumid/18/postid/9616/view/topic/Default.aspx

What would be the best way to handle this?

Item Quantity
--------------------
Item1 3
Item2 0
Item3 5
Item4 4
-----
12

I need a way to limit the qty to 10. Is there a way for validation to count the inputs and display a message box stating you have exceeded the maximum quantity?

Thanks,
James

svedire
Cruiserweight
Posts:107

10/02/2008 4:52 PM Alert 
Hi James,

I think you can do this using JavaScript and the <span> tag- "CustomValidatorEvaluateIsValid"

The following <span> tag goes into your footer.

<span id="vQty"
controltovalidate="frmQty[Item]"
errormessage="Limit quantity"
display="Dynamic"
group = "YourGroup"
evaluationfunction = "CustomValidatorEvaluateIsValid",
clientvalidationfunction = "LimitQty",
initialvalue="" class="mystarHidden">Limit quantity
</span>

And your JS function has to check the sum of the values of the <input> fields..

Hope this helps

Thanks,
Sindura
R2integrated

pauldes
Immortal
Posts:1392

10/02/2008 7:20 PM Alert 
Well, not being much of a js guru, I would do this in your actions and sum the form field values, then IF sum of your action execute is greater than your threshold, set and action variable to an error message and display on the screen.

ListX....makes you look brilliant, even though you're not.
You are not authorized to post a reply.
Forums > Bi4ce.Modules.ListX > General > Limit total inputs on submit



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