I have a jQuery "accordian" with each section(5) having a form. A few of these forms need to update some of the other forms so I'm trying the Taconite jQuery plugin.
I have this working in that if you fill in one form, it passed the information to a processing page which does it's thing (database interaction, set vars, etc...) and formats two separate div's which each update as they should.
My problem is that if you change the form (either of them) and resubmit them, nothing happens - the form does nothing (as verified using Firebug)!
If someone could shed some light on this I would be very appreciative :-)
Here's the javascript -
<script>
$(document).ready(function() {
$.taconite.debug = true;
$("#get_it").click(function() {
var B_FName = $("#B_FName").val();
var B_LName = $("#B_LName").val();
var B_Email = $("#B_Email").val();
var B_Address1 = $("#B_Address1").val();
var B_Address2 = $("#B_Address2").val();
var B_City = $("#B_City").val();
var B_State = $("#B_State").val();
var B_Zip = $("#B_Zip").val();
var B_Phone = $("#B_Phone").val();
$.get('example3.lasso', {
B_FName: B_FName,
B_LName: B_LName,
B_Address1: B_Address1,
B_Email: B_Email,
B_Address2: B_Address2,
B_City: B_City,
B_State: B_State,
B_Zip: B_Zip,
B_Phone: B_Phone
});
});
});
I know it could be done better but I'm a JavaScript neophyte and have been "cramming" over the past several weeks to find and understand a solution!
If someone knows how to get the form fields working with serialize that would be great too(I tried with no success but didn't spend too much time yet - I'm just trying to get the basics working first!):
And here is what is returned from the processing page (copied directly from the response in Firebug - the only difference is there was another form identical to this one just with a different div name):
<taconite>
<replace select="#billingInfo">
<div id="billingInfo">
<p>First Name: <input type="text" id="B_FName" value="James" /><br />
Last Name: <input type="text" id="B_LName" value="Jones" /><br />
Email: <input type="text" id="B_Email" value="james@jones.com" /><br />
Address 1: <input type="text" id="B_Address1" value="123 4th Street" /><br />
Address 2: <input type="text" id="B_Address2" value="Apt. 21b" /><br />
City: <input type="text" id="B_City" value="somewhere" /><br />
State: <input type="text" id="B_State" value="OR" /><br />
Zip: <input type="text" id="B_Zip" value="90042" /><br />
Phone: <input type="text" id="B_Phone" value="555-555-5555" /><br /></p>
</div>
</replace>
</taconite>
The HTML is a simple form without a form tag, surrounded by the properly named div - all text inputs with a button to send the data -nothing fancy right now.
Thank you for any help :-)