Ally12 Ally12 - 1 month ago 20
jQuery Question

Can I use .load() JQuery function to process a form?

I have a simple question. I have searched online for the answer but have not found one.

Basically, I have an ASPX page

form.aspx
that contains a form and logic to handle that form in the code behind.

I have written code to load the
form.aspx
page into a
<div>
that is on lets say
process.aspx
. To load
form.aspx
into
process.aspx
, I used the
.load()
function from jQuery and it renders correctly.

My question now is, can I load the form with the
.load()
function and still process the form? I will be trying to incorporate AJAX for the submit as well.

I know that It works in terms of rendering, I'm just not sure if this method is meant to render and allows me to process the rendered form on submit.

Does anyone have any experience with the
.load()
function or am I just using the method incorrectly?

Answer

According to the documentation you can use .load() to do both a Post or a Get. So in theory you could use it to process any values submitted in the specified data parameter.