Results 1 to 2 of 2

Thread: Adding More Options to the PHP/JScript

  1. #1
    Join Date
    Oct 2012
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Adding More Options to the PHP/JScript

    Someone posted some HTML/Jscript and a PHP coding to help me with doing the following:

    I'm creating a web page that will have software information on: basic description, operating system, free/commercial, etc. All the content will be placed (or generated) on one page. Dropdown filters at the top of the content will allow someone to select a "filter" (i.e. Windows) and it will auto remove all content (software) that doesn't work on Mac or Linux.
    They gave me a place to start, but I am not familiar with writing PHP or jscript (Jquery).

    Here is what it does: see here

    Which is great it's a starting point, but how would I go about doing the following:

    I have three dropdowns that I need:

    Operating System Options: Windows, Mac, & Linux
    Type: 2D, 3D, and 2d & 3D
    Free/Commercial: Free, Commercial, Free & Commercial
    Reset

    The reset button will reset the filters.
    Any help is appreciated.

    THE CODE

    index.html
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Gallery Exg</title>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    </head>
    <body>
    <label for="filterBox">Box1</label>
    <select name="filterBox" id="filterBox">
    <option value="">- Select -</option>
    <option value="Windows">Windows</option>
    <option value="Linux">Linux</option>
    </select><br />
    <div class="filterResults">
    <h1>Windows</h1>
    <h1>Linux</h1>
    </div>
    <script type="text/javascript">
    $(function(){
        $('#filterBox').change(function(){
            var Value=$(this).val();
            $.post('filter.php', {selectedValue: Value}, function(data) {
                if(data) $('.filterResults').html(data);
                else location.reload();
            });
        });
    });
    </script>
    </body>
    </html>
    filter.php
    Code:
    <?php
    if($_REQUEST['selectedValue']) {
        //here print the datas from database related to the selected value
        echo '<h1>'.$_REQUEST['selectedValue'].'</h1>';   
    }
    ?>
    vRespectfully,
    Kage
    Last edited by keyboard; 10-13-2012 at 01:37 AM. Reason: Unformat: Changed my mind

  2. #2
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Have a look at this
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

Similar Threads

  1. JScript Radio Buttons and checkboxes
    By arye in forum JavaScript
    Replies: 9
    Last Post: 12-23-2010, 04:41 PM
  2. adding options to a select list
    By hosdank in forum JavaScript
    Replies: 12
    Last Post: 08-22-2008, 04:09 PM
  3. Adding Options to a Select element
    By fileserverdirect in forum JavaScript
    Replies: 17
    Last Post: 12-16-2007, 12:45 AM
  4. A JScript action within a form
    By multichild in forum JavaScript
    Replies: 2
    Last Post: 01-04-2007, 11:45 AM
  5. JScript for rollover on pictures?
    By 32jln in forum JavaScript
    Replies: 9
    Last Post: 08-08-2005, 04:58 PM

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
  •