Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 285813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:34:49+00:00 2026-05-12T05:34:49+00:00

HTML <ul> <li id=listSize style=display: block;> <label class=topspace>Field Size:</label> <select id=fieldSize name=fieldSize> <option>Choose a

  • 0

HTML

<ul>
    <li id="listSize" style="display: block;">
        <label class="topspace">Field Size:</label>    
        <select id="fieldSize" name="fieldSize">
            <option>Choose a size </option>
            <option value="small">Small</option>
            <option value="medium">Medium</option>
            <option value="large">Large</option>
        </select>
    </li>
    <li id="listPhoneFormat" class="right half" style="display: none;">
        <label class="topspace">Phone Format</label>
        <select id="fieldSize" name="fieldSize">
            <option selected="selected" value="phone" id="fieldPhoneAmerican">### - ### - ####</option>
            <option value="europhone" id="fieldPhoneEuro">International</option>
        </select>
    </li>
    <li id="listOptions" style="display: none;">
        <label class="topspace">Options:</label>
        <input id='required' name="required" type='checkbox'>Required</input>
    </li>
    <li id="listInstructions" style="display: none;">
        <label class="topspace">Instructions for User </label>
        <textarea cols="40" id="instructions" name="instructions" rows="20" style="width: 98%; height: 70px;"></textarea>    
    </li>
</ul>

JQuery

<script type="text/javascript">
    $(document).ready(function () {
        $('#fieldSize').fieldValue();
    });
</script>

where I am using the Form plugin

it shows the correct value only I kept the li with id=”listSize” as an first option
And if I kept it below as the last li or in between it didn’t works ..Why so??

Also How to make one li to display:none and display:block on some actions by JQuery???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:34:49+00:00Added an answer on May 12, 2026 at 5:34 am

    You have two DOM elements with the id fieldSize (one presumably refering to listSize, the other refering to listPhoneFormat). You should rename those so that each id is unique, otherwise you’ll never know for sure which DOM element you are retrieving.

    Once the id fieldSize is unique, you can retrieve the value for a form element with the id fieldSize like this:

    var fieldSizeVal = $("#fieldSize").val();
    

    Of course, this will work for any id that maps to a form element.

    Hiding and showing you can do like this:

    $("#fieldSize").show(); // show the DOM element with id fieldSize
    $("#fieldSize").hide(); // hide the DOM element with id fieldSize
    

    These functions work for any DOM element or set of DOM elements, not just for form elements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HTML: <div style=display:block>Text</div> <div style=display:block>Text</div> <div style=display:none>Text</div> <div style=display:none>Text</div> <div style=display:none>Text</div> How do I
html is <table> <tr> <td><img src=ex.jpg id=image class=edit name=n1></td> <td><img src=ex.jpg id=image class=edit name=n2></td>
HTML <div class=ph> </div> <div class=ph> </div> Javascript $(function(){ var htmlStr = '\ <select
HTML <tr url=domain.com> <td><input type=checkbox name=checkbox[] method=post value= class=checkbox /> </td> </tr> JS $(tr).not('.checkbox').click(function(){
HTML: <ul id=categories_list class=ui-sortable> <li class=cat_row style=> item1 </li> <li class=cat_row style=> item2 </li>
HTML <select id=selectDepartment> <option value=1>120</option> <option value=2>20</option> <option value=3>140</option> <option value=4>4120</option> <option value=5>560</option> <option
Html <div class=lang-currency-field> <div class=lang-currency-links>links here</div> </div> jQuery <script> $('.lang-currency-button').click(function() { $('.lang-currency-field').fadeIn(); }); $('.lang-currency-links').click(function()
html structure: <form method=post id=comment-form accept-charset=UTF-8> <div class=form-item form-type-textfield form-item-name> <input type=text id=edit-name name=name
HTML: <table> <tr class=not-counted><th>Heading 1</th></tr> <tr><td>key1</td><td>val1</td></tr> <tr><td>key2</td><td>val2</td></tr> <tr class=not-counted><th>Heading 2</th></tr> <tr><td>key3</td><td>val3</td></tr> </table>​ CSS style:
HTML Code: <div class=checkbox style= float:left ></div> <input type=checkbox class=realcheckbox id=financing /> jQuery Code:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.