Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
Show/Hide DIV on dropdown Value on html + JS

Would you please help me how to show and hide DIV based on dropbox value?

if selected value = M then #M_link and #P_link show. elseif selected value = Y then #M_link show and #P_link hide. else #M_link and #P_link hide.

below is my HTML code.

<div class="setting_element ">
                <p class="label"><?php echo $lang['room_m_type']; ?></p>
            <select id="set_room_type_movie">
            <option value=""><?php echo $lang['select_m_type'];?></option>
            <option value="M" <?php if ($room['mtype'] == "M") { echo 'selected="selected"';}?>><?php echo $lang['room_m_mp4'];?></option>
            <option value="Y" <?php if ($room['mtype'] == "Y") { echo 'selected="selected"';}?>><?php echo $lang['room_m_youtube'];?></option>
            </select>
            </div>
        <div id = "m_link"class="setting_element">
            <p class="label"><?php echo $lang['room_movie_link']; ?></p>
            <input id="set_room_movie_link" maxlength="" class="full_input" value="<?php echo $room['movie']; ?>" type="text"/>
        </div>
        <div id = "p_link" class="setting_element">
            <p class="label"><?php echo $lang['room_poster_link']; ?></p>
            <input id="set_room_poster_link" maxlength="" class="full_input" value="<?php echo $room['poster']; ?>" type="text"/>
        </div>  

thank you in advance.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you can set change event listener on select then by getting value you can hide and show by using ifelse statement or switch.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!