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 6953679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:30:37+00:00 2026-05-27T14:30:37+00:00

I am designing a HTML web page which allows the user to query an

  • 0

I am designing a HTML web page which allows the user to query an xml file. Basically, they choose the column they would like to query, the search type and then type in their value. However, if they choose between in the combo box, then after the first text input box, I would like an & label, and another input box to appear.

The current code is below:

<form name="myform" action="podcatalog.xml" method="POST">
<select id="ddl" onchange="configureDropDownLists(this,'ddl2')">
<option value="author">Author</option>
<option value="title">Title</option>
<option value="pages">Pages</option>
<option value="year">Year</option>
</select>

<select id="ddl2" onchange="configureTextFields(this, 'querystring')">
</select>

<input type="text" name="querystring"/>

<input type="submit" value="Search"/>

</form>

<script type="text/javascript">
function configureDropDownLists(ddl1,ddl2) {
    var string = new Array('Contains', 'Equals');
    var number = new Array('=', '<', '>', 'Between', '!=' );

    switch (ddl1.value) {
        case 'author':
            document.getElementById(ddl2).options.length = 0;
            for (i = 0; i < string.length; i++) {
                createOption(document.getElementById(ddl2), string[i], string[i]);
            }
            break;

        case 'title':
            document.getElementById(ddl2).options.length = 0;
            for (i = 0; i < string.length; i++) {
                createOption(document.getElementById(ddl2), string[i], string[i]);
            }
            break;

        case 'pages':
            document.getElementById(ddl2).options.length = 0;
            for (i = 0; i < number.length; i++) {
                createOption(document.getElementById(ddl2), number[i], number[i]);
            }
            break;

        case 'year':
            document.getElementById(ddl2).options.length = 0;
            for (i = 0; i < number.length; i++) {
                createOption(document.getElementById(ddl2), number[i], number[i]);
            }
            break;

            default:
                document.getElementById(ddl2).options.length = 0;
            break;
    }

}

function createOption(ddl, text, value) {
    var opt = document.createElement('option');
    opt.value = value;
    opt.text = text;
    ddl.options.add(opt);
}

function configureTextFields(ddl2) {
    switch (ddl2.value) {
        case 'Between':

        // Need code here?

  • 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-05-27T14:30:38+00:00Added an answer on May 27, 2026 at 2:30 pm

    You would need to add a div after the first input box with a css class on it to hide the div. Then when your configureTextFields(this, 'querystring') fires if the item chosen is between then you’ll use javascript to remove the css class.

    Personally I’d recommend looking into using jquery for this. Here is a thread from another forum that is doing something similar.

    http://www.webdeveloper.com/forum/showthread.php?t=194923

    If your not familiar with jquery you will want to check it out, it can make your life a whole lot easier. http://jquery.com/

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

Sidebar

Related Questions

I'm designing a very simple web page (HTML only), the only feature I want
I am designing an html web page that mimics inline panes by defining this
I am designing a custom HTML helper and I would like to execute Html.ActionLink
I am designing a regular expression tester in HTML and JavaScript. The user will
I'm a new comer to web designing. I created my web page layout using
I'm new to web designing. I started to designing a sample page but I
I have a web page I'm designing, and I am trying to have icons
I am designing a web application which will be doing three things: 1) store
I'm designing an html email for a Holiday Art Market. The request is simply
What, if any, considerations (HTML, CSS, JavaScript) should you take when designing for Google

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.