I'm new to Javascript but want to do the following: on form submit, if a certain field in my form is "No", redirect them to a Stripe checkout page. I have it working with onFormSubmit, but I don't know how to get the field so that I can show the checkout page conditionally based on the value of the form field. Here is what I have so far:
From here I would just want to add an if statement along the lines of "if(formFieldValue === 'No') { callStripe(); }. How can I grab the value of a form field for the form that has just been submitted?
Hi @WendyGoh - thanks for the quick response. I think I am close, but could you let me know what I'm doing wrong when testing for the field's value here?
Hi @WendyGoh - thanks for the follow-up! Strangely enough, I was not able to get the values for any of my form fields that way - they all simply returned "undefined". I found a workaround using the .serialize() function: