Current location: Hot Scripts Forums » Programming Languages » PHP » Alphabetize Drop-Down Box


Alphabetize Drop-Down Box

Reply
  #1 (permalink)  
Old 11-30-04, 03:57 PM
nuzzle nuzzle is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 26
Thanks: 0
Thanked 4 Times in 4 Posts
Alphabetize Drop-Down Box

Just wondering if there is anyway possible to put choices in a drop-down menu in alphabetic order?
I tried putting them in alpha order myself through mysql, but when its listed on the site, its not... :/

any help would be appreciated!

Thanks,
Keith
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-30-04, 04:14 PM
bizzar528's Avatar
bizzar528 bizzar528 is offline
Community Liaison
 
Join Date: Sep 2004
Location: Pennsylvania, US
Posts: 1,551
Thanks: 2
Thanked 16 Times in 15 Posts
Maybe by javascript, but I'm doubting it.

It's very easy to do when you use the Mysql functions. ORDER BY something DESC or ASC usually does the trick. What was the query statement you were trying? Maybe we can help ya with that.
__________________
Yep, it's a signature...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-30-04, 05:03 PM
nuzzle nuzzle is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 26
Thanks: 0
Thanked 4 Times in 4 Posts
here is the code from the site im trying to search from...

[php]
<!--S:Search-->
<script language="JAVAScript" >
function Model(newmodel) {

var models = new Array();

{SCRIPT}


for (var i = document.forms[0].model.options.length ; i >= 0 ; i--)
document.forms[0].model.options[i] = null;

if (newmodel == "" )
return "";
//adding the new values;

for (var i = 1 ; i < models[newmodel].length ; i++)
document.forms[0].model.options[i-1] = models[newmodel][i];


}
</script>

<form action="search.php" method="get">
<table align="center">
<tr>
<td>Make & Model</td>
<td>{MAKE} & {MODEL}</td>
<tr>
<td>Price range:</td>
<td>From: $<input type="text" name="pf" value="{PF}" size="5">
To: $<input type="text" name="pt" value="{PT}" size="5">
</td>
</tr>
<tr>
<td>Year range:</td>
<td>From: <input type="text" name="yf" value="{YF}" size="5">
To: <input type="text" name="yt" value="{YT}" size="5">
</td>
</tr>
<tr>
<td align=center colspan=2><input type="submit"></td>
</tr>
</table>
</form>
<!--E:Search-->

<!--S:Select-->
<select name="{NAME}" onchange="{ONCHANGE}">
<option value="">[ select ]</option>
{OPTIONS}
</select>
<!--E:Select-->

<!--S:SelectOption-->
<option {SELECTED} value="{VALUE}">{NAME}</option>
<!--E:SelectOption-->
[php]

Hope that helps?? Also, with this site, it has catagories... ie different "makes" How can I link to just one type of "make" instead of listing all of them?

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop Down Box OMID SOFT JavaScript 1 10-15-04 10:58 AM
Drop Down menu order peterc PHP 1 08-20-04 03:23 AM
Shout box, comment box, or search script. Need help to find all! Spreegem Script Requests 1 05-29-04 10:45 PM
drop down menu problem !!! nurqeen PHP 1 02-08-04 09:07 PM
drop the lowest number TheLaughingBandit ASP 2 08-30-03 02:57 PM


All times are GMT -5. The time now is 06:39 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.