close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding Server validations to multiple insert behavior text fields, ie text fields in a repeat selection

Thread began 12/11/2013 6:21 am by CraigR | Last modified 12/11/2013 12:54 pm by Jason Byrnes | 243 views | 4 replies |

CraigRBeta Tester

Adding Server validations to multiple insert behavior text fields, ie text fields in a repeat selection

I have a form designed for booking tickets, the availability and ticket prices are both event dependent and membership dependent.
I have all of the infrastructure in place, the only thing missing is the ability to validate the ticket quantity field against a stored value.
I tried using the server validations server behaviour, but this doesn’t seem to give me what I need, as the value being validated is set from a form value retrieved from a recordset.
Is this something I can do with WA_server validations ?

Sign in to reply to this post

Jason ByrnesWebAssist

no, server validations wont be able to do this, you will need to hand code it.

add a hidden element in the repeat region that will store the maximum number of tickets for each line.

outside of the repeat region, add another hidden element. the repeat region uses an incrementing number on each element name. Use the variable for this incrementing number as the value for this hidden element. this will pass the number of lines that the repeat contains.

use that in a loop to compare the quantity field with the max quantity field.

Sign in to reply to this post

CraigRBeta Tester

I suspected as much

  add a hidden element in the repeat region that will store the maximum number of tickets for each line.  



Ok, I did this

  outside of the repeat region, add another hidden element. the repeat region uses an incrementing number on each element name. Use the variable for this incrementing number as the value for this hidden element. this will pass the number of lines that the repeat contains.  



I created a field called field count, using $RepeatSelectionCounter_1 as its value, (but the value doesn’t seem to match the number of lines)


  use that in a loop to compare the quantity field with the max quantity field.  




I did this, setting a flag called $invalid to true if the ticket limit exceeds the ticket quantity.

I then added the invalid flag as a criteria to my insert behaviour, so it doesn’t fire if invalid is true.

What this achieves is a pass or fail, which a big step in the right direction.

What I would like to do is show the pass or fail on each row.
I have attached the code to help clarify

Attached Files
booktickets_wip.php
Sign in to reply to this post

Jason ByrnesWebAssist

That will take further custom coding, see PM

Sign in to reply to this post

CraigRBeta Tester

PM

Sign in to reply to this post

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...