导航回来时下拉不坚持

时间:2015-05-08 13:31:51

标签: java javascript jquery

不确定我做错了什么,但当我导航到另一个页面然后返回时,我选择的信息不再存在。

这是有效的代码。这是一个普通的与会者:

<div class="linegroup">
<label class="notrequired" id="dietaryNeed_g1">Meal Preferences</label>
<select name="dietaryNeedValue_g1" id="dietaryNeedValue_g1" class="lbl-col-right" onclick="mealPrefs();">
    <optgroup label="Please Select Your Meal Preferences">
        <%--<%=cache.getValueListHTML( "ALL_MEALCODE", addSelect, d)%>--%>
            <option value=""></option>
            <option value="DAIRY" <%if(formFields.getDisplayValue( "dietaryConsiderationsOther_g1").equalsIgnoreCase( "Dairy-Free")){ %>selected
                <%}%>>Dairy Free</option>
            <option value="FOODALLE" <%=formFields.getSelectValue( "dietaryNeedValue_g1", "FOODALLE")%>>Food Allergy</option>
            <option value="KOSHER" <%=formFields.getSelectValue( "dietaryNeedValue_g1", "KOSHER")%>>Kosher</option>
            <option value="HALAL" <%=formFields.getSelectValue( "dietaryNeedValue_g1", "HALAL")%>>Halal</option>
            <option value="VEGAN" <%=formFields.getSelectValue( "dietaryNeedValue_g1", "VEGAN")%>>Vegan</option>
            <option value="VEGTRIAN" <%=formFields.getSelectValue( "dietaryNeedValue_g1", "VEGTRIAN")%>>Vegetarian</option>
            <option value="GLUTFREE" <%=formFields.getSelectValue( "dietaryNeedValue_g1", "GLUTFREE")%>>Gluten-Free</option>
            <option value="OTHER" <%=formFields.getSelectValue( "dietaryNeedValue_g1", "OTHER")%>>Other</option>
    </optgroup>
</select>

这是访客的代码。出于某种原因,只要我转到下一页然后导航回来,这个下拉就会消失。

<div class="linegroup">
<label class="required" id="dietaryNeed_g<%=i%>">Meal Preferences</label>
<select name="dietaryNeedValue_g<%=i%>" id="dietaryNeedValue_g<%=i%>" data-parsley-trigger="focusout" class="firstselect lbl-col-right" onchange="mealPrefs();" novalidate>
    <optgroup label="Please Select Your Meal Preferences">
        <%--<%=cache.getValueListHTML( "ALL_MEALCODE", addSelect, d)%>--%>
            <option value=""></option>
            <option value="DAIRY" <%if(formFields.getDisplayValue( "dietaryConsiderationsOther_g"+ i).equalsIgnoreCase( "Dairy-Free")){ %>selected
                <%}%>>Dairy Free</option>
            <option value="FOODALLE" <%=formFields.getSelectValue( "dietaryNeedValue_g" + i, "FOODALLE")%>>Food Allergy</option>
            <option value="KOSHER" <%=formFields.getSelectValue( "dietaryNeedValue_g" + i, "KOSHER")%>>Kosher</option>
            <option value="HALAL" <%=formFields.getSelectValue( "dietaryNeedValue_g" + i, "HALAL")%>>Halal</option>
            <option value="VEGAN" <%=formFields.getSelectValue( "dietaryNeedValue_g" + i, "VEGAN")%>>Vegan</option>
            <option value="VEGTRIAN" <%=formFields.getSelectValue( "dietaryNeedValue_g" + i, "VEGTRIAN")%>>Vegetarian</option>
            <option value="GLUTFREE" <%=formFields.getSelectValue( "dietaryNeedValue_g" + i, "GLUTFREE")%>>Gluten-Free</option>
            <option value="OTHER" <%=formFields.getSelectValue( "dietaryNeedValue_g" + i, "OTHER")%>>Other</option>
    </optgroup>
</select>

有关如何制作访客留言的任何想法?

0 个答案:

没有答案