waynemac Posted February 28, 2005 Posted February 28, 2005 Hi all, thanx always for the great help I get here. I have been tweeking The Address Book that I run on my www site to run on my mobile site. TAB has a drop down menu that is used to select a Group inwhich people a listed. When a new Group is selected an sql query is run and the appropriate results are shown. When I run this on my mobile site no sql query is run as they mobile system here in Japan doesnt seem set up for this function. I'm wanting to either convert the drop down menu to a list that links to the same results OR add a GO button to force the change. Is this easily done? Here's some code from my php.... <TR> <TD> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=240> <TR VALIGN="bottom"> <TD CLASS="headTitle"><?php echo("$group_name"); ?></TD> <TD CLASS="headText" ALIGN=right> <FORM NAME="selectGroup" METHOD="get" ACTION="<?php echo(FILE_LIST); ?>"> Select Area <SELECT NAME="groupid" CLASS="formSelect" onChange="document.selectGroup.submit();"> <?php // -- GENERATE GROUP SELECTION LIST -- // Only admins can view hidden entries. if ($_SESSION['usertype'] == "admin") { $groupsql = "SELECT groupid, groupname FROM " . TABLE_GROUPLIST . " AS grouplist WHERE groupid >= 0 ORDER BY groupname"; } else { $groupsql = "SELECT groupid, groupname FROM " . TABLE_GROUPLIST . " AS grouplist WHERE groupid >= 0 AND groupid != 2 ORDER BY groupname"; } $r_grouplist = mysql_query($groupsql, $db_link); while ($tbl_grouplist = mysql_fetch_array($r_grouplist)) { $selectGroupID = $tbl_grouplist['groupid']; $selectGroupName = $tbl_grouplist['groupname']; echo(" <OPTION VALUE=$selectGroupID"); if ($selectGroupID == $group_id) { echo(" SELECTED"); } echo(">$selectGroupName</OPTION>¥n"); } ?> </SELECT> ....... The Address Book can be found at http://www.corvalis.net/address/ and something Im working one can be found at http://www.fukuokaguide.com/barclubs/list.php Hope someone can help. Regards, Wayne Quote
owatagal Posted March 1, 2005 Posted March 1, 2005 Are you sure it's a problem with the mobile device and not javascript generally? Since your code ends with the </select> button, it isn't clear if you have a submit button built into the form. Do you have a non-javascript version that works on websites? Or does the menu always stop working if javascript is turned off? If it is a case of javascript, check out WebDevTips' jump menu: http://www.webdevtips.com/webdevtips/codeg...ickgoplus.shtml When a user has javascript turned on, the jump menu works like you want it to--pick an option and the form submits automatically. But if javascript is off, you get a submit button instead. You'll probably have to modify the code a bit, since you've already built some javascript in there, but I use a variation of this on one of my sites for something similar--pick an author, a menu with all their books pops up kind of thing. It works well. I think it should work for you--since you mentioned adding a "go" button as a possible solution. Quote
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.