SAJAX and Form fields

Is there a way to submit all form fields via a sajax function call? I think this is sajax anyway.

We are using Mediawiki and the function call is "sajax_do_call (funcName, [params], callbackFuncName)"

I'm just wondering if there is a jsut way to remove all fields from the form in params?

0


source to share


1 answer


Unfortunately I don't know very much about Mediawiki, but if you can add JQuery to your page, just:

var myParams = $ ("form"). serializeArray ();

... will take all the values โ€‹โ€‹of the form and create a param array for you.



To add jQuery, you can download the core jQuery and include it in your page via the <script> tag, or include it via a copy hosted on Google:

<script type = "text / javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"> </ script>

0


source







All Articles