biggieuk Posted November 22, 2006 Share Posted November 22, 2006 Hi all,Im having trouble with a certain function on my booking form.In my database i have a 'session' table which contains sessionid,capacity,placesbookedOn the form i have a few textboxes name,email,address etc.. and 45 radio buttons split into 4 groups. Each radio button corresponds to a sessionid.I want the booking form to check and see if any values in 'placesbooked' are equal to the capacity and if so disable the radiobutton on the form which corresponds to the sessionid value so that it is unclickable.Whats the best approach to this as i am stuck :(thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/28128-disable-radiobutton-upon-database-value/ Share on other sites More sharing options...
joshi_v Posted November 23, 2006 Share Posted November 23, 2006 Is this what you are looking for?[code]<?php<input type="radio" name="name" value="1" <?php if($placesbookid==$capacity) echo "disabled";?>>?>[/code]RegardsJoshi Quote Link to comment https://forums.phpfreaks.com/topic/28128-disable-radiobutton-upon-database-value/#findComment-129012 Share on other sites More sharing options...
biggieuk Posted November 23, 2006 Author Share Posted November 23, 2006 Hi,I added <?php if($placesbooked==$capacity) echo "disabled";?> to the value of each radiobutton.This makes each radiobutton disabled and doesnt check that '$placesbooked==$capacity'.Do i need to assign the variables $placesbooked & $capacity to the value in the database for this to work?[code]<?php <input name="session1" type="radio" value="T6" <? if($placesbooked==$capacity) echo "disabled";?>> ?>[/code]thanks for your help,Dan Quote Link to comment https://forums.phpfreaks.com/topic/28128-disable-radiobutton-upon-database-value/#findComment-129076 Share on other sites More sharing options...
joshi_v Posted November 24, 2006 Share Posted November 24, 2006 That will depend on your script!Better to provide script! Quote Link to comment https://forums.phpfreaks.com/topic/28128-disable-radiobutton-upon-database-value/#findComment-129554 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.