Jquery Modal form with validations and conditional logic

I have been building an app and have encountered a road block related to AJAX form submission. I am having trouble including in-line validations and getting the form to submit.

My app is integrated with Stripe for payments. I am using client_side_validations gem for in-line form validation.

Here's the user flow:

1. Non-user clicks the "buy" button for a post

2. 'transactions/form' modal dialog form opens: contains a form that creates a new transaction and optionally- a new user (registration)

3. form contains stripe credit card fields and optional password/email fields, also contains hidden fields for information about the post (id, price, etc...)

4. User has two options:

a. enter only credit details

b. enter credit details and password/email, i.e. register

5. click submit

6. IF: option a, only credit details have been entered

- validate card

- charge credit card

- close modal and make appropriate changes to the page

7. IF: option b, credit card + registration details have been entered

- validate card and user details

- create user

- create customer and charge customer

- close modal and make appropriate changes to the page

8. the post is changed from 'active' to 'inactive'

If you take on the job, I'll add you as a contributor to my private github repo

The files and line numbers that need work are:

[url removed, login to view] line: 43- the create action

[url removed, login to view]

[url removed, login to view]

pages/[url removed, login to view] line: 24

transactions/[url removed, login to view]

The big questions are:

-where to put and how to implement validations for the new user/transaction modal form

-how to submit the modal form

-how to update the page after form submission

Would be forever indebted to you if you could take on this job, or at the very least take a look at my code and suggest something.

Taidot: Ruby on Rails

Näytä lisää: building jquery conditional form, validate credit card, registration flow, job id card, html to haml, how to make a line card, gem update, active forever, repo job, is my credit card active, html haml, github price, github how to, RB, Modal, github page, charge charge card, jquery form ajax validation, post form hidden, html form modal, jquery fields, dialog ajax, app jquery, email button jquery, modal form

Tietoa työnantajasta:
( 0 arvostelua ) Santa Barbara, United States

Projektin tunnus: #4277722