I have this ul in my form
<ul/>
items are not form elements and will not be posted when the form is submitted. If you need to capture these values you can store them in a hidden
form element.
Example to capture the text into a hidden field, add a hidden field.
<input type="hidden" id="activeThing" name="activeThing"/>
And bind a click event to the li
:
$("ul li.not_the_dot").click(function(){
$("#activeThing").val($(this).find("a").text());
});
html form only submits only value of its input(element like input, textarea, select) tags to server in params.
so if you want to send something to the sever make it an input element. If you have some predefine variable or values to send to the server use hidden fields for it.
Are you expecting the UL to send information to the form? It will not. You need to use a form input (i.e. SELECT, TEXT, TEXTAREA, RADIO, CHECKBOX, HIDDEN, etc.)
There is nothing in your UL -> LI HTML that will send data through the form. You will need to alter the code so when it outputs the active LI, it will output something like:
<input type="hidden" name="active" value="Standard">
Then it will be passed to the form.
The <ul>
and <li>
elements are not form elements, so they will not be submitted when POSTing the form. You either need to convert the <li>
values to be form controls e.g. radio buttons or selects, or, add some event handling javascript to the <li>
elements so that when they're selected (or whatever event is performed on them) a hidden field is updated with the value. The hidden form field will get submitted in the POST.