Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8873975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:36:14+00:00 2026-06-14T18:36:14+00:00

Hi i have the following javascript and DropDownList: function loadanlasstyp(ddl) { var ControlName =

  • 0

Hi i have the following javascript and DropDownList:

function loadanlasstyp(ddl) {
            var ControlName = document.getElementById(ddl.id);

            if (ControlName.value == "Event") {
                window.location = "../book/event.aspx";

            }

            else if (ControlName.value == "Short Meeting") {
                window.location = "../book/shortmeeting.aspx";
            }
            return true;

        }

DropDownList:

<asp:DropDownList ID="ddlAnlasstyp" runat="server" CssClass="ff" Height="21px" onChange="javascript:loadanlasstyp(this)"
                        TabIndex="3" Width="150px">
                        <asp:ListItem Value="Short meeting">Short</asp:ListItem>
                        <asp:ListItem Value="Event">Event</asp:ListItem>
</asp:DropDownList>

I have the Javascript function and the Dropdownlist on both Pages, so that i can switch between them.
“Shortmeeting.aspx” is loading per default. I can switch from “Shortmeeting.aspx” to “Event.aspx” if i click “EVENT” in the DropDownList. Now if i want to Switch back to “Shortmeeting.aspx”, for that i click on “SHORT” in the DropDownList, but it does not work.

How can i switch between these two pages correcly? Please Help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:36:15+00:00Added an answer on June 14, 2026 at 6:36 pm

    Just remove the empty space in value

    Value=”Short meeting”

         to 
    

    Value=”Short”

    else if (ControlName.value == "Short") {
                window.location = "../book/shortmeeting.aspx";
            }
    

    Empty spaces creates problems sometimes when doing string match comparison. you can create a string comparison function for future reference.

    function strcmp(a, b) {
    if (a.toString() < b.toString()) return -1;
    if (a.toString() > b.toString()) return 1;
    return 0;
    

    }

    function strcmp(a, b) {
        a = a.toString(), b = b.toString();
        for (var i=0,n=Math.max(a.length, b.length); i<n && a.charAt(i) === b.charAt(i); ++i);
        if (i === n) return 0;
        return a.charAt(i) > b.charAt(i) ? -1 : 1;
    }
    

    see this link for reference link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have The Following JavaScript Function: function validateLocality(object, args) { if (document.getElementById(<%=ddlLocality.ClientID %>).value ==
I have following Javascript line in my ASP.NET web app: document.getElementById('<%=myTextBox[0].ClientID %>').value = test;
I have the following Javascript code that works perfectly: $(document).ready(function() { $(#Select1).setDefault(); $(#Select2).setDefault(); $(#Select3).setDefault();
I have the following javascript. window.location.href = _searchUrl + query.replace(/\s+/g, '+') .replace('/', '-') .replace('\\','-')
I have following Javascript objects: function Alfa() { this.status=''; this.setStatus = function(value) { this.status=value
I have following javascript class: var ImageGallery = function(arr) { var ImgArr = arr;
I have this following javascript to activate sometime document.addEventListener('touchmove', function (e) { e.preventDefault(); },
How to access the asp.net dropdownlist selecteditem value from javascript? I have the following
I have the following javascript: $(document).ready(function() { $('#<%= DropDownList1.ClientID %>').change(function() { $('#<%= TextBox1.ClientID %>').disabled
I have the following JavaScript code: var x = ['CFMG','JMFMG','CPMAF']; var y = $.param({'test':x});

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.