Revision 5075
Added by daigle about 15 years ago
lib/style/common/ajax-utils.js | ||
---|---|---|
33 | 33 |
function submitFormIntoDiv(url, formId, divId) { |
34 | 34 |
//alert('Sending form: ' + formId + " to url: " + url); |
35 | 35 |
var formObj = document.getElementById(formId); |
36 |
//alert('Form object: ' + formObj); |
|
36 | 37 |
|
37 | 38 |
var myRequest = new Ajax.Updater(divId, url, |
38 | 39 |
{ method: 'post', |
39 | 40 |
parameters: Form.serialize(formObj), |
40 | 41 |
}); |
42 |
//alert("after update"); |
|
41 | 43 |
} |
42 | 44 |
|
45 |
/* submits a form via ajax and inserts the results into the given div |
|
46 |
* Params: |
|
47 |
* url - url to hit |
|
48 |
* formId - id of the form to submit |
|
49 |
* divId - the name of the div where the results should be put |
|
50 |
*/ |
|
51 |
function submitFormObjIntoDiv(url, formObj, divId) { |
|
52 |
//alert('Form object: ' + formObj); |
|
53 |
|
|
54 |
var myRequest = new Ajax.Updater(divId, url, |
|
55 |
{ method: 'post', |
|
56 |
parameters: Form.serialize(formObj), |
|
57 |
}); |
|
58 |
//alert("after update"); |
|
59 |
} |
|
60 |
|
|
43 | 61 |
/* submits a url via ajax and inserts the results into the given div |
44 | 62 |
* Params: |
45 | 63 |
* url - url to hit |
Also available in: Unified diff
submit a form into a div via ajax using either form id or form object