Skip to content
Advertisement

jQuery send data to a new open tab and get the data

I want to send some data from ClassA to ClassB . So what I did is I create a hidden form in my ClassA view page and post it to ClassB.

JavaScript

Then from the js part

JavaScript

But then I dont know how can I get the post data from ClassA. I have tried getting the data from $_POST in the php controller but it didnt work.

ClassB controller

JavaScript

but what I get is all null value. So how can I get the post data value from class A?

Advertisement

Answer

With post data you can only send value attribute. You can add another two hidden fields.

JavaScript

Or you can use jquery post to send data without submission.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement