Question about referencing last button pressed on a page
-
I have a form where a user is able to hit a button to show a dropdown menu. If they hit a different button, the first dropdown menu is hidden and a different one appears. I have different buttons that each use this logic.
jQuery(‘.dropdown1’).show();
jQuery(‘.dropdown2’).hide();
jQuery(‘.dropdown3’).hide();etc.. This allows the user to browse one dropdown at a time by hitting a different button.
The user is able to browse the dropdowns and eventually choose one of the items and continue to the next page.
Now later in the form, I want to output the last item they selected in those dropdowns by using something like:
jQuery(‘#result’).html(‘You selected ‘+LAST FIELD NAME SELECTED’);
})()Note where it says “LAST FIELD NAME SELECTED” is where I am stuck. I don’t know how to reference the last field when
a.) They fields don’t seem to be logically grouped together
b.) The user may pick several different items from several dropdowns. How do I tell it to pick just the last one?
Sorry if this is a bit of a complex question. Can I use a fieldset or div container for this?
- The topic ‘Question about referencing last button pressed on a page’ is closed to new replies.