Here we will discuss how this is done. See the code below that we use to send the form info to WhosOn.
function WO_add_blurs()
This function adds the onblur event to each input field on the form. The blur event is similar to the OnValidate event, and is called when a user moves focus from the input field.
WO_add_blurs loops through all the INPUT elements, and if they are radio, text, or check boxes then it adds a function to be called when each blurs
After this it loops through all the select elements (list boxes & text boxes) and does the same.
function WO_blurred(e)
This is the function that is called after the blur event occurs. It takes the event parameter e, which is passed automatically by the blur event, and gets the element from the DOM.
From this element, it uses the WO_which_element function to get the correct element name.
If the element is a valid element, and the value is not an empty string, then it calls wo_send_data with the name and the value that is set.
function WO_send_data(name, value)
This function uses the data from the main WhosOn javascript file to send the information to the WhosOn database.