CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Arrow OnChange Filter To First Value Request

    Hello
    I am running a php & java script that when searching for a property, it uses the onchange feature for three fields regarding the location of the property.
    for example: Country, Parish, Area

    When you choose a country, you then choose a Parish(which correspons to the country) and then an Area (that corresponds to the Parish)

    Thing is, I am only using one country and would like the script to automatically show/filter to that country rather than 'Any'. For example I would want the Country field to show United Kingdom as a default.

    Here is a link to a screenshot of how it looks now:
    http://tinypic.com/view.php?pic=vncsw5&s=5


    And here is a segment of the code from the php file that it uses to change the fields

    Code:
     <form action="<?php echo URL ?>/search.php" method="POST" name="form">
    
    
    
    
    <?php echo $lang['WHERE']; ?>:</h2>
    
    <?php echo $lang['Location1'] ?> <br>
    <select name="location1" class="span3" onchange="update(this, locations);">
    <option></option>
    <option></option>
    <option></option>
    </select>
    <br>
    <br>
    <?php echo $lang['Location2'] ?> <br>
    <select name="location2" class="span3" onChange="update(this, locations);">
    <option></option>
    <option></option>
    <option></option>
    </select>
    <br>
    <br>
    <?php echo $lang['Location3'] ?> <br>
    <select name="location3" class="span3">
    <option></option>
    <option></option>
    <option></option>
    </select>
    
    <input type="hidden" name="form" value="1">
    <input type="hidden" name="loc" value="">
    
    <br><br>
    What i want is to filter to first value(United Kingdom) by default in the dropdown (location1)
    I checked on the net and it was suggested to have another javascript running after the listbox using selectedIndex=1 but I'm not sure how to implement it.

    Any help would be greatly appreciated
    Thanks
    Last edited by PeejAvery; January 11th, 2009 at 08:23 PM.

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured