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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:51:53+00:00 2026-06-02T08:51:53+00:00

In the form below, how do I get autoselect the various options based on

  • 0

In the form below, how do I get autoselect the various options based on the values of my URL parameters?

eg: http://example.com/?type=%28shirt%2C+tshirt%2C+t-shirt%29&length=25&width=17&expand=yes

        <form name="shirty" method="get">
            <select name="type" />
            <option value="(shirt, tshirt, t-shirt)">T-Shirt</option>
            <option value="(hoodie, sweatshirt)">Sweatshirt</option>
           </select>

          <select name="length" />
            <option value="select">Select a length</option>
            <option value="14">14 Inches</option>
            <option value="15">15 Inches</option>
            <option value="16">16 Inches</option>
            <option value="17">17 Inches</option>
            <option value="18">18 Inches</option>
            <option value="19">19 Inches</option>
            <option value="20">20 Inches</option>

           </select>


            <select name="width" />
            <option value="select">Select a Width</option>
            <option value="14">14 Inches</option>                
            <option value="15">15 Inches</option>
            <option value="16">16 Inches</option>
            <option value="17">17 Inches</option>
            <option value="18">18 Inches</option>
            <option value="19">19 Inches</option>
            <option value="20">20 Inches</option>
           </select>

          <input type="checkbox" name="expand" value="yes"" checked><small>include ± 1 inch?</small>

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

        </form>
  • 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-02T08:51:55+00:00Added an answer on June 2, 2026 at 8:51 am

    Got it.

            <form name="shirty" method="get">
                <select name="type" />
                 <?php //create the select options
                    $options = "
                        <option value=\"(shirt, tshirt, t-shirt)\">T-Shirt</option>
                        <option value=\"(hoodie, sweatshirt)\">Sweatshirt</option>";
                        $saved = $type;
                    $saved = (!empty($saved))? $saved: false;
                    if ($saved)
                        //if there is a saved data set the option to selected
                        $options = str_replace('value="'.$saved.'"','value="'.$saved.'" selected="selected"',$options);
                    //echo out the options
                    echo $options; ?>
                    ?>
               </select>
    
    
              <select name="length" />
                <?php //create the select options
                    $options = "
                        <option value=\"14\">14 Inches</option>
                        <option value=\"15\">15 Inches</option>
                        <option value=\"16\">16 Inches</option>
                        <option value=\"17\">17 Inches</option>
                        <option value=\"18\">18 Inches</option>
                        <option value=\"19\">19 Inches</option>
                        <option value=\"20\">20 Inches</option>";
    
                        $saved = $length;
                    $saved = (!empty($saved))? $saved: false;
                    if ($saved)
                        //if there is a saved data set the option to selected
                        $options = str_replace('value="'.$saved.'"','value="'.$saved.'" selected="selected"',$options);
                    //echo out the options
                    echo $options; ?>
                    ?>
               </select>
    
    
                <select name="width" />
                <?php //create the select options
                    $options = "
                        <option value=\"14\">14 Inches</option>
                        <option value=\"15\">15 Inches</option>
                        <option value=\"16\">16 Inches</option>
                        <option value=\"17\">17 Inches</option>
                        <option value=\"18\">18 Inches</option>
                        <option value=\"19\">19 Inches</option>
                        <option value=\"20\">20 Inches</option>";
                        $saved = $width;
                    $saved = (!empty($saved))? $saved: false;
                    if ($saved)
                        //if there is a saved data set the option to selected
                        $options = str_replace('value="'.$saved.'"','value="'.$saved.'" selected="selected"',$options);
                    //echo out the options
                    echo $options; ?>
                    ?>
               </select>
    
              <input type="checkbox" name="expand" value="yes"" checked><small>include ± 1 inch?</small>
    
              <input type="submit" name="Submit" value="Search" />
    
              </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this form below: <form fbcontext=65d93ec1624a id=app23744633048_frmFBNewsletter action=http://register.stage.creative.com/Api/Facebook/SubscribeNewsletter method=post><input type=hidden value=117533374986109 name=fb_sig_profile><input type=hidden
The php code below get's the results from a form and inserts them into
I have built a simple registration form shown below and Iam trying to get
For example: I have an Contact object on the form (see below). Can i
I have a form like below:- <% using ( Html.BeginForm(search, home, FormMethod.Get) ) {
I have got below code to GET dictionary type of session variable value. Please
I'm using the below for get in php without a form. If($q) { header(location:d.php?q=$name);
I have the below form in my view: <% form_for(@filedata, :url=>{ :controller=>filedatas, :action=>create}, :multipart
Form the below string I would like to get the index of the starting
When i try to submit the form below i get this error WARNING: Can't

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.