<...">

Ul in form not submitting in $ _POST

I have this ul in my form

<form action="step1/" method="post" enctype="multipart/form-data" id="form">
    <div class="tabs">
        <ul>
            <li class="dot clicked radio_buttons"></li>
            <li class="active not_the_dot"><span class="l"></span><a href="#">Standard Class</a><span class="r"></span></li>
            <li class="dot radio_buttons"></li><li class="not_the_dot"><span class="l"></span><a href="#">Business Class</a><span class="r"></span></li>
            <li class="dot radio_buttons"></li><li class="not_the_dot"><span class="l"></span><a href="#">Premium</a><span class="r"></span></li>
        </ul>
....
....
....

and then I have other elements in the form as well

 <select name="quantity_id" class="quantity_select">
            <option selected="selected" value="0">SELCT STATION QUANTITY</option>
            <option value="1">1 Station</option>
            <option value="2">2 Station</option>
            <option value="3">3 Station</option>
            <option value="4">4 Station</option>
            <option value="5">5 Station</option>
    </select>

and on the submit form, id_number is present, but the ul value is not .... is there something I need to change to make this value available .... basically I need an “active” class text like Standard, business

+3
source share
4 answers
Items

<ul/>are not form elements and will not be sent when the form is submitted. If you need to write these values, you can save them in a form element hidden.

Example for capturing text in a hidden field, add a hidden field.

<input type="hidden" id="activeThing" name="activeThing"/>

And bind the click event to li:

$("ul li.not_the_dot").click(function(){
  $("#activeThing").val($(this).find("a").text());
});
+8
source

html (, input, textarea, select) .

, - sever, . - , .

+2

<ul> <li> , . <li> , . javascript <li>, ( ) . POST.

+2

Do you expect UL to submit information on the form? I will not. You need to use form input (i.e. SELECT, TEXT, TEXTAREA, RADIO, CHECKBOX, HIDDEN, etc.)

In your UL → LI HTML, nothing will be submitted via the form. You will need to change the code, so when it issues an active LI, it will produce something like:

<input type="hidden" name="active" value="Standard">

Then it will be submitted to the form.

+1
source

All Articles