beanymanuk Posted March 17, 2011 Share Posted March 17, 2011 Hi I posted this in the HTML Help forum and been suggested JQuery is the best way to solve the below problem anyones help on this would be very much appreciated Hi I am trying to make a lightbox appear if a radio button in a form it set to yes but not display if set to no and carry on to the forms target page eg results.php Yes / No radio buttons are at the bottom of the form <form id="#####" method="get" accept-charset="UTF-8" action="/####" class="right-nav"> Sales <input type="radio" name="s" value="S" checked> Lettings <input type="radio" name="s" value="L" > <select name="t" id="myList" class="select" style="width: 120px"> <option value="pleaseSelect">Property Type</option> <option value="">All</option> <option value="Terraced">Terraced</option> <option value="Semi">Semi</option> <option value="Detached">Detached</option> <option value="Flat">Flat</option> <option value="Bungalow">Bungalow</option> <option value="Maisonette">Maisonette</option> <option value="Mews">Mews</option> <option value="Commercial">Commercial</option> <option value="Land">Land</option> </select> <select name="bedrooms" id="myList2" class="select" style="width: 120px"> <option value="pleaseSelect">Min Beds</option> <option value="">1</option> <option value="">2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> </select> <select name="price[min]" id="myList3" class="select" style="width: 120px"> <option value="pleaseSelect">Min Value</option> <option value="">Any</option> <option value="100000">£100,000</option> <option value="200000">£200,000</option> <option value="300000">£300,000</option> <option value="400000">£400,000</option> <option value="500000">£500,000</option> </select> <select name="price[max]" id="myList4" class="select" style="width: 120px"> <option value="pleaseSelect">Max Value</option> <option value="">Any</option> <option value="100000">£100,000</option> <option value="200000">£200,000</option> <option value="300000">£300,000</option> <option value="400000">£400,000</option> <option value="500000">£500,000</option> </select> <input type="text" size="16" name="keyword" class="right-nav-keyword" value="" onclick="this.value=''" style="border-color: rgb(0, 85, 164); border:1px solid; width: 110px;"> <p class="right-text"> <b>E-Mail Alerts</b><br>Would you like to save these search criteria for your property e-mail alerts? <p>Yes <input type="radio" name="Type" value="Yes"> No <input type="radio" name="Type" value="No" checked></p> <div class="rounded-button"> <input type="submit" value="Search" class="form-submit"></div> <div class="rounded-button"> <input type="submit" value="Map Search" class="form-submit"></div> </form> Thankyou Quote Link to comment https://forums.phpfreaks.com/topic/230904-show-div-on-submit-if-radio-button-set-to-yes/ Share on other sites More sharing options...
sunfighter Posted March 22, 2011 Share Posted March 22, 2011 To make the light box visible you need a javascript function. It's not in your code. To activate that code change this line <p>Yes <input type="radio" name="Type" value="Yes"> No <input type="radio" name="Type" value="No" checked></p> to this <p>Yes <input type="radio" name="Type" value="Yes" onclick="function name goes here"> No <input type="radio" name="Type" value="No" checked></p> This will make to box appear right now, if you need it delayed we have to do something else. Find code for this here: http://www.onlineseohelp.com/blog/42/How_To_Create_A_Lightbox_To_Display_Text_Or_Images/ Quote Link to comment https://forums.phpfreaks.com/topic/230904-show-div-on-submit-if-radio-button-set-to-yes/#findComment-1190686 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.