I have a form that on submission, stores the record in a seperate DB table and also creates a user using the CB Plugin. Great works well.
However, I have a question on that form made up of 2 radio buttons that says "Join Shop?" 1) YES 2) NO
This is why I use CB Plugin. If a user selects yes, jquery opens a div that has desired username, pass, and verifypass text boxes. The are validated to make sure there is a value in them. and they are mapped to CB fields using the plugin. Great. This works great. Users get created.
The problem is when a user selects no, theres a bit of javascript that turns the validation off so the form doesnt throw any errors & this doesnt open any extra divs, so the user never sees the username/pass/verifypass text boxes. Unfortunately, when I submit the form the CB plugin then throws an error because it needs username and password and verifypassword as they are required fields by CB.
Basically, what I would like it to is if user has selected no, then using some method (serverside validation maybe??) to disable the CB plugin on the form and not pass the data along to it. as it will give me username and password not supplied error?
I hope that makes sense?
I thought abuot using serverside validation and having the php do a sql query to update the enabled status of the plugin for that form, but I cant seem to find where in the DB it is flagged that CB plugin is enabled or disabled for that form. All I could find is what Chrono fields are mapped to which CB fields and to which form they are associated.
Any help/ideas/hacks would be greatly appreciated.
However, I have a question on that form made up of 2 radio buttons that says "Join Shop?" 1) YES 2) NO
This is why I use CB Plugin. If a user selects yes, jquery opens a div that has desired username, pass, and verifypass text boxes. The are validated to make sure there is a value in them. and they are mapped to CB fields using the plugin. Great. This works great. Users get created.
The problem is when a user selects no, theres a bit of javascript that turns the validation off so the form doesnt throw any errors & this doesnt open any extra divs, so the user never sees the username/pass/verifypass text boxes. Unfortunately, when I submit the form the CB plugin then throws an error because it needs username and password and verifypassword as they are required fields by CB.
Basically, what I would like it to is if user has selected no, then using some method (serverside validation maybe??) to disable the CB plugin on the form and not pass the data along to it. as it will give me username and password not supplied error?
I hope that makes sense?
I thought abuot using serverside validation and having the php do a sql query to update the enabled status of the plugin for that form, but I cant seem to find where in the DB it is flagged that CB plugin is enabled or disabled for that form. All I could find is what Chrono fields are mapped to which CB fields and to which form they are associated.
Any help/ideas/hacks would be greatly appreciated.