Skip to content
Advertisement

Send data that has nothing to do with button to modal using AJAX

I have this Ajax function:

JavaScript

It takes this button properties(value and id) and sends them to the modal via post:

JavaScript

Now, I need to take a data that has nothing to do with the button ($row[‘nomeDepartamento’];):

JavaScript

and send it via the same ajax function to the modal.

How would I do this?

Thank you!

Advertisement

Answer

This is how your button will look like

JavaScript

and retrive the $row['nomeDepartamento']; & after click funciton declare variable

JavaScript

and send this in data:{} and after success change html of any element like $("element").html(nomeDepartamento) and there you go.

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