SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    eez
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Fat javascript bug ... need help

    Hi!

    I have a javascript page made up of 3 select menus (much more html though!) :

    <TABLE width="100%" cellPadding=0 cellSpacing=0>
    <TBODY>
    <TR>
    <TD ><FONT>Total: {total} Displaying: {displaying}</FONT>
    <SELECT name="order" onchange="javascript:if (order.value != '') {self.location = '{script}.php?page={page}{query}{cid}{bool}&order=' + order.value;}">
    <OPTION value="">Order by/OPTION>
    <OPTION value="created">Created</OPTION>
    <OPTION value="updated">Updated</OPTION>
    <OPTION value="title">Title</OPTION>
    <OPTION value="snapshot">Snapshot</OPTION>
    <OPTION value="description">Description</OPTION>
    <OPTION value="rating">Rating</OPTION>
    <OPTION value="votes">Votes</OPTION>
    <OPTION value="m_rating">Review Rating</OPTION>
    <OPTION value="r_count">Reviews</OPTION>
    <OPTION value="hits">Hits</OPTION>
    <OPTION value="favorite">Favorites</OPTION>
    <OPTION value="sponsor">Sponsor listings</OPTION>
    <OPTION value="dls">Downloads</OPTION>
    <OPTION value="img_link">Image listings</OPTION>
    </SELECT>
    <SELECT name="sort" onchange="javascript:if (sort.value != '') {self.location = '{script}.php?page={page}{query}{cid}{bool}&sort=' + sort.value;}">
    <OPTION value="">Sort/OPTION>
    <OPTION value="ASC">Ascending</OPTION>
    <OPTION value="DESC">Descending</OPTION>
    </SELECT>
    <SELECT name="show" onchange="javascript:if (show.value != '') {self.location = '{script}.php?page={page}{query}{cid}{bool}&show=' + show.value;}">
    <OPTION value="">Show/OPTION>
    <OPTION value="5">5</OPTION>
    <OPTION value="10">10</OPTION>
    <OPTION value="20">20</OPTION>
    <OPTION value="50">50</OPTION>
    </SELECT>
    </TD>
    </TR>
    </TBODY>
    </TABLE>


    The bug consists of:

    Step 1: I choose the DESC sort mode
    URL string : /?sort=DESC

    Step 2: I choose the description order
    URL string : /?order=desc


    Have already seen the bug???
    Look at the red string! It isn't description but desc!!

    Can someone solve this I'd be very glad!

    Thanks

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    instead of order.value at the end of your onchange, use this.options[this.selectedIndex].value
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •