Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
Inline validation issue
Posted: 25 May 2012 01:05 AM   [ Ignore ]
Cleans up Nice!
RankRank
Total Posts:  234
Joined  2011-09-22

Hi.

I am having trouble getting some inline validation working now that I have several global option groups.

My code is:

rules:item_options[standard_sizes]="required" error_handling="inline 
{if error:item_options[standard_sizes]}<class="error_message">ErrorPlease select a print option above.</p>{/if} 

This works pefectly if the entry has the standard sizes option, but if it has another option it doesnt work.

I tried this but with no luck:

rules:item_options[standard_sizes]="required" rules:item_options[pano_sizes]="required" error_handling="inline 
{if error:item_options[standard_sizes]}<class="error_message">ErrorPlease select a print option above.</p>{/if} 
{if error:item_options[pano]}<class="error_message">ErrorPlease select a print option above.</p>{/if} 

My concern is, even if the above worked, if my client added a new group the validation wouldnt work on it.

How can I have the validation work on which ever global option group the entry uses?

Thanks

 

Profile
 
 
Posted: 25 May 2012 07:45 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10279
Joined  2008-09-29

This specific type of validation is not something that’s built into cartthrob… essentially dynamic rule setting. I’ll have to think about this one. There’s not going to be a solution in the short term. A custom extension to the add to cart system could be created to handle the advanced validation… but the standard system won’t handle dynamic rules based on available options.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 28 May 2012 07:33 AM   [ Ignore ]   [ # 2 ]
Cleans up Nice!
RankRank
Total Posts:  234
Joined  2011-09-22

Okay Chris. I will use JS for this instead.

Profile