Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member Hitch - CP's Avatar
    Join Date
    Jun 2009
    Location
    London
    Posts
    120
    Member #
    19164
    Hey guys,

    I have a page on wordpress and I am trying to get a list that comes up with a number of different options. When you click on an option, I am wanting that list-item to be selected and the hyperlink attached to take the user to the desired page.

    The current page is: Squad Page - LM Crusaders HC

    The code in hdeaer.php:

    Code:
    <script LANGUAGE="javascript">
        
        function OnChange(dropdown)
        {
            var myindex  = dropdown.selectedIndex
            var SelValue = dropdown.options[myindex].value
            var baseURL  = <Some value based on SelValue>
            top.location.href = baseURL;
            
            return true;
        }
        
        </SCRIPT>

    The code in the template page:

    Code:
    <select name=select1 onchange='OnChange(this.form.select1);'>
            <option value="http://www.google.com">google</option>
            <option value="http://www.apple.com">apple</option>
            <option value="http://www.yahoo.com">yahoo</option>
            </select>

    I'm not very savvy when it comes to JavaScript so this may well be (and probably is) completely wrong.

    I have tried to piece this all together from tutorials as I have never done this before ...it can't be this hard!

    Many thanks for any help,
    Ali
    Ali Hitch

    Portfolio & Tutorial Site
    www.alihitch.com

  2.  

  3. #2
    Senior Member
    Join Date
    Dec 2009
    Location
    Chicago, IL
    Posts
    114
    Member #
    20579
    Liked
    2 times
    Error: missing = in XML attribute
    Source File: Squad Page - LM Crusaders HC
    Line: 27, Column: 29
    Source Code:
    var baseURL = <Some value based on SelValue>

    Meaning that you're not setting the baseURL correctly, but you should just send the user to the SelValue var value, as it seems that you're putting an extra step in there for no reason.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:20 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com