dlebowski Posted June 4, 2007 Share Posted June 4, 2007 Below is a portion of my form that I am using to display a value, but have the ability to change the value and submit the change to the database. It works perfectly in Firefox, but doesn't not in IE 7. Can anyone offer any suggestions? Thanks as always. <TD width=98 height="29" align="center"> <? echo '<select name="ud_OnlineOnsite">'; echo '<option'.($OnlineOnsite=="ONLINE"? ' selected' : '').'>ONLINE</option>'; echo '<option'.($OnlineOnsite=="ONSITE"? ' selected' : '').'>ONSITE</option>'; echo '</select>'; ?> </td> Quote Link to comment https://forums.phpfreaks.com/topic/54144-solved-select-works-in-firefox-but-not-ie/ Share on other sites More sharing options...
dlebowski Posted June 4, 2007 Author Share Posted June 4, 2007 I forgot to tell you "what doesn't work". When I select a value to submit to update the database in IE7, the value doesn't not get updated. It does however update when I use firefox. Quote Link to comment https://forums.phpfreaks.com/topic/54144-solved-select-works-in-firefox-but-not-ie/#findComment-267684 Share on other sites More sharing options...
trq Posted June 4, 2007 Share Posted June 4, 2007 echo '<option'.($OnlineOnsite=="ONLINE"? ' selected="selected"' : '').'>ONLINE</option>'; Also... where do you define $OnlineOnsite? Quote Link to comment https://forums.phpfreaks.com/topic/54144-solved-select-works-in-firefox-but-not-ie/#findComment-267685 Share on other sites More sharing options...
dlebowski Posted June 4, 2007 Author Share Posted June 4, 2007 This is the result of a DB query. $OnlineOnsite is populated from a field in my table. <? include("dbinfo.inc.php"); mysql_connect("localhost",$username,$password); @mysql_select_db($database) or die( "Unable to select database"); // get value of id that sent from form submission $LotAuctionDate=$_GET['ud_LotAuctionDate']; $query=" SELECT * FROM lots WHERE LotAuctionDate='$LotAuctionDate' ORDER BY LotNumber"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <table> <TD width="69" class="maroonbar"> <center>Type</center> </TD> </table> <? $i=0; while ($i < $num) { $OnlineOnsite=mysql_result($result,$i,"OnlineOnsite"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/54144-solved-select-works-in-firefox-but-not-ie/#findComment-267691 Share on other sites More sharing options...
trq Posted June 4, 2007 Share Posted June 4, 2007 Did you try the code I posted? It is valid html. Quote Link to comment https://forums.phpfreaks.com/topic/54144-solved-select-works-in-firefox-but-not-ie/#findComment-267694 Share on other sites More sharing options...
kenrbnsn Posted June 4, 2007 Share Posted June 4, 2007 Are you using an image for your submit button? IE & FF return different values to your script when using an image. Ken Quote Link to comment https://forums.phpfreaks.com/topic/54144-solved-select-works-in-firefox-but-not-ie/#findComment-267701 Share on other sites More sharing options...
dlebowski Posted June 4, 2007 Author Share Posted June 4, 2007 Thorpe, Here is what I have. What is odd is that it now will let me change a value in IE 7 from Onsite to Online, but it will not let me change it from Online to Onsite. Any ideas on why that would be? I'm closer than I was. Thanks for helping. <TD width=98 height="29" align="center"> <? echo '<select name="ud_OnlineOnsite">'; echo '<option'.($OnlineOnsite=="ONLINE"? ' selected="selected"' : '').'>ONLINE</option>'; echo '<option'.($OnlineOnsite=="ONSITE"? ' selected="selected"' : '').'>ONSITE</option>'; echo '</select>'; ?> </td> <td><input value ="UPDATE" type="Button" onclick="updatelotslive(ud_OnlineOnsite.value)"></td> Quote Link to comment https://forums.phpfreaks.com/topic/54144-solved-select-works-in-firefox-but-not-ie/#findComment-267703 Share on other sites More sharing options...
dlebowski Posted June 4, 2007 Author Share Posted June 4, 2007 I finally got this one figured out after some helpful suggestions. Here is what it needs to look like to work: <TD width=98 height="29" align="center"> <select name="ud_OnlineOnsite" align=center> <option value="ONLINE" <? if ($OnlineOnsite == "ONLINE") echo "selected"; ?> >ONLINE</option> <option value="ONSITE" <? if ($OnlineOnsite == "ONSITE") echo "selected"; ?> >ONSITE</option> </select> </td> Quote Link to comment https://forums.phpfreaks.com/topic/54144-solved-select-works-in-firefox-but-not-ie/#findComment-267841 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.