I am working one a page like the
below
id="first_div">
action='forms_invoice.php' method='post'>
border="0">
>Customer
I am working one a page like the
below
id="first_div">
action='forms_invoice.php' method='post'>
border="0">
>Customer
Name | type="text" value="" id="customers_name"> |
Bill To | > id="customers_billto_addr"> |
Left
Div(first_div) contains Invoice Data and Right side Div(second_div) is for displaying
additional info or update like displaying a customer info or if it's a new customer,
create a new customer data.
What I want to do
is when submitting a new customer info, i want to the left side div stay unchanged while
submitting right side customer form and after done creating customer log, update
customer list(drop down) in the left side
div(invoice)
The part I don't know is
" do I submit to a page(forms_customer.php) or is there a way to wrap all elements in
second_div and send them with jquery maybe with post method?
Answer
Give each form an identifier (name, id, class
etc...) then target them with jquery and serialize
e.g:
$("#left-side-form").on("submit",function(e){
e.preventDefault();
var formData =
$(this).serialize();
var action = $(this).attr("action");
$.ajax(action, formData, function(response){
//update select
values in left side form here
......
}
});
I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...
No comments:
Post a Comment