CMS Development

EHessler
Member

onFormSubmit is broken?

SOLVE
0 Upvotes
1 Accepted solution
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

onFormSubmit is broken?

SOLVE

Hey @EHessler - the video was very helpful.

 

I believe the issue is with the .find() method. 

 

.find('input[name="credit_score"]').val()

 

This will likely always return the very first value out of the available radio options, regardless of which one is selected.

 

The reason is that input[name="credit_score"] matches every single radio option, as each option has the same name attribute, so it just returns the first one it sees.

 

You could try using something that looks for whether the input is selected, i.e. 

 

('input[name="credit_score"]:checked')

 

Hope this helps!

 


✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

0 Upvotes
1 Reply 1
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

onFormSubmit is broken?

SOLVE

Hey @EHessler - the video was very helpful.

 

I believe the issue is with the .find() method. 

 

.find('input[name="credit_score"]').val()

 

This will likely always return the very first value out of the available radio options, regardless of which one is selected.

 

The reason is that input[name="credit_score"] matches every single radio option, as each option has the same name attribute, so it just returns the first one it sees.

 

You could try using something that looks for whether the input is selected, i.e. 

 

('input[name="credit_score"]:checked')

 

Hope this helps!

 


✔️ Did this post help answer your query? Help the community by marking it as a solution.

0 Upvotes