KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance. Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried the form manually and it only submits once. The 1st part of the jQuery code relates to opening up a lightbox and pulling values from the table underneath, I have included it in case for whatever reason it is a potential problem. jQuery Code: $(document).ready(function(){ $('.form_error').hide(); $('a.launch-1').click(function() { var launcher = $(this).attr('id'), launcher = launcher.split('_'); launcher, launcher[1], $('td .'+launcher[1]); $('.'+launcher[1]).each(function(){ var field = $(this).attr('data-name'), fieldValue = $(this).html(); if(field === 'InvoiceID'){ $("#previouspaymentsload").load("functions/invoicing_payments_received.php?invoice="+fieldValue, null, function() { $("#previouspaymentsloader").hide(); }); } else if(field === 'InvoiceNumber'){ $("#addinvoicenum").html(fieldValue); } $('#'+field).val(fieldValue); }); }); $("#addpayment_submit").click(function(event) { $('.form_error').hide(); var amount = $("input#amount").val(); if (amount == "") { $("#amount_error").show(); $("input#amount").focus(); return false; } date = $("input#date").val(); if (date == "") { $("#date_error").show(); $("input#date").focus(); return false; } credit = $("input#credit").val(); invoiceID = $("input#InvoiceID").val(); by = $("input#b
Tags (comma-separated)
Save Edits
Cancel