Quantcast
Channel: DevNet Questions
Viewing all articles
Browse latest Browse all 8832

Form Validation with Macro

$
0
0
Hello, I could use a hand setting up some form validation. We are setting up event registration through a form that has a checkbox for each event date. The idea is to check if a specific day is already at capacity when a checkbox is selected. I setup the following macro to get a count of existing registrations and now I'm wondering how to properly use this to trigger the error message when the Count of registrations is higher than the Max that I set in the code:{% Max = 1; Total = GlobalObjects.Classes[@BizForm.EventTest@].Items.ItemsAsFields.cb3; Count = 0; foreach (Response in Total) { if (Response == True){ Count += 1 }; } if(Count @ Max){ return true; } else{ return false; } #%} This will probably be re-written but I am just trying to get an idea of how to use a macro for form validation in this way.Any help would be appreciated!Best Regards, Sandro

Viewing all articles
Browse latest Browse all 8832

Trending Articles