Hi!
i have a form that can have different number of text fields (hoding translation value). Their names are for example: "textfield_eng", "textfield_ger", "textfield_dut".
in my ajax request i want these fields submitted ofcourse, but i can't figure out how to populate these field names and their values in to the data string.
This is what the data call looks like:
$.ajax({
type: "POST",
url: $("#optionForm").attr("action"),
dataType: "xml",
cache: false,
data: { formname: $("#optionForm input[name='formname']").val(),
submit: $("#optionForm input[name='submit']").val()
},
success: function(xml){
bladibla....
And this is how i would like it to have:
$.ajax({
type: "POST",
url: $("#optionForm").attr("action"),
dataType: "xml",
cache: false,
data: { formname: $("#optionForm input[name='formname']").val(),
submit: $("#optionForm input[name='submit']").val(),
textfield_eng : "english",
textfield_ger : "german",
textfield_dut : "dutch"
},
success: function(xml){
bladiblla...
What is the best way to do this?
<input id="sOption_dut" name="sOption_dut" class="form_textfield" type="text" value="" />
<input id="sOption_eng" name="sOption_eng" class="form_textfield" type="text" value="" />
<input id="sOption_ger" name="sOption_ger" class="form_textfield" type="text" value="" />