jquery - Need help writing a Javascript to add values -


i need in writing javascript code form. need add values in text fields(credit cards, payday loans , unsecured personal loans) , if total gets more or equal $10000, on submit should take user page 1, else page 2. want add first 3 fields, doesn't matter user inputs in other fields. here's form:

<form action="/fsg?pageid=0bd004f9-aabc-486e-be09-bf2621555e3e&amp;variant=b" method="post"> <input type="hidden" name="pageid" value="0bd004f9-aabc-486e-be09-bf2621555e3e"><input type="hidden" name="pagevariant" value="b"> <fieldset class="clearfix" style="width: 297px; height: -17px;"> <div class="lp-pom-form-field clearfix" id="container_what_state_do_you_live_in"> <label for="what_state_do_you_live_in" class="main lp-form-label" id="label_what_state_do_you_live_in">    state? *</label><select id="what_state_do_you_live_in" name="what_state_do_you_live_in" class="text form_elem_what_state_do_you_live_in">    <option value="">select state</option>    <option value="arizona">arizona</option>    <option value="california">california</option>    <option value="florida">florida</option>    <option value="michigan">michigan</option>    <option value="nevada">nevada</option>    <option value="new york">new york</option>    <option value="pennsylvania">pennsylvania</option>    <option value="texas">texas</option>    <option value="virginia">virginia</option>    <option value="i reside in state.">i reside in state.</option></select> </div> <div class="lp-pom-form-field clearfix" id="container_credit_cards"> <label for="credit_cards" class="main lp-form-label" id="label_credit_cards">credit cards</label><input type="text" id="credit_cards" name="credit_cards" class="text form_elem_credit_cards"> </div> <div class="lp-pom-form-field clearfix" id="container_payday_loans"> <label for="payday_loans" class="main lp-form-label" id="label_payday_loans">payday loans</label><input type="text" id="payday_loans" name="payday_loans" class="text form_elem_payday_loans"> </div> <div class="lp-pom-form-field clearfix" id="container_unsecured_personal_loans"> <label for="unsecured_personal_loans" class="main lp-form-label" id="label_unsecured_personal_loans">unsecured personal loans</label><input type="text" id="unsecured_personal_loans" name="unsecured_personal_loans" class="text form_elem_unsecured_personal_loans"> </div> <div class="lp-pom-form-field clearfix" id="container_student_loans"> <label for="student_loans" class="main lp-form-label" id="label_student_loans">student loans</label><input type="text" id="student_loans" name="student_loans" class="text form_elem_student_loans"> </div> <div class="lp-pom-form-field clearfix" id="container_auto_loan"> <label for="auto_loan" class="main lp-form-label" id="label_auto_loan">auto loan</label><input type="text" id="auto_loan" name="auto_loan" class="text form_elem_auto_loan"> </div> <div class="lp-pom-form-field clearfix" id="container_medical_bills"> <label for="medical_bills" class="main lp-form-label" id="label_medical_bills">medical bills</label><input type="text" id="medical_bills" name="medical_bills" class="text form_elem_medical_bills"> </div> <input type="submit" name="submit" id="submit" value="submit"> </form> 

var total = $('#creditcards').val() + $('#payday').val() + $('#unsecured').val();     $('.submit').click(function(){     if(total<10000)        {window.href.location = "x"}     else{        window.href.location = "y";     } }) 

Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -