I have some forms whose ID's are dynamically created via PHP by including a variable called "invno" as shown here:
As you can see in the "action" attribute, I'm calling this function:
- <form name="formEditInvoice<?php echo $invno ?>" id="formEditInvoice<?php echo $invno ?>" method="post" action="javascript: SubmitEditedInvoice(<?php echo $invno ?>);" onsubmit="javascript: return ValidateForm(this);">
The problem I'm having is that no data is passed to the PHP back end. I have verified that the variable invno is correctly passed to the javascript function, and have tested my .serialize() by using a hard-coded form ID, but I still get no data passed through.
- function SubmitEditedInvoice(invno) {
$.post('output.php?mode=6&invno=' + invno, $('#formEditInvoice' + invno).serialize(),
function(output){
$('#ajaxinvoices').html(output);
});
}
Can anyone see what's wrong with my code?
TIA