0
On one page I upload a list of people with a checkbox next to each one. I want to move to the next page all the people I selected. I’m trying to do it like this:
In this code below I check who is selected and add in the Nips variable. This code works perfectly.
$(".check:checked").each(function(){
if($(".check:checked").is(':checked'))
{ var nip = $(this).parent().next( 'td' ).text();
nips.push(nip);
}
}) ;
Now in this code below I pass by post the variable Nips(an array).
This code works in part.
$.ajax({
type: "POST",
data: { nips:nips },
url: "../pdfporturma.php",
dataType: "html"
});
Why in part? Because it doesn’t point to the other page (../pdfporturma.php). By firebug I see the correct result, showing the vector items all right, but I can’t move to this other page carrying this data.
Resposta do firebug:
array(1) {
["nips"]=>
array(2) {
[0]=>
string(8) "85808610"
[1]=>
string(7) "6506224"
}
}
How do I do it? I’ve tried window.open but it doesn’t pass the data.
Unfortunately it didn’t work. It just doesn’t open the page with the data for me to work on. I wanted it to open preferably in a new tab. In this target php file I use the fpdf class to generate multiple letters in a single pdf file.
– Jorge Luis
Aaah yes, I understand what you mean
– Hiago Souza
more ai, you could not recover a PDF via AJAX
– Hiago Souza
has a better shape
– Hiago Souza
create a post form so you do the default procedure with it then you would put the target attribute="BLANK" and the method as post ai you would put a css property to keep it hidden. Ai you assign an ID and use the $('#id_do_form'). Ubmit() then it will go by post in a new window.
– Hiago Souza
I put in the answer an example.
– Hiago Souza
@Hiagosouza in my case that in the form is what comes from mysql , it has no name"algumacoisa" as I can do
– allan araujo
What do you mean? I don’t understand, you create the correct HMTL document?
– Hiago Souza
@Hiagosouza my form is dynamic , the request table comes from mysql via ajax and jquery , hence the user clicks on the requests he wants. How do I send what was selected to mysql , and if it was a form with name"something " would be easy but my form is dynamic has no name"" how can I do ?
– allan araujo