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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:24:06+00:00 2026-05-15T16:24:06+00:00

I have regular form like this. <form action=/domainchecker.php method=post> <input type=text name=domain size=20> <fieldset>

  • 0

I have regular form like this.

    <form action="/domainchecker.php" method="post">    
    <input type="text" name="domain" size="20">

    <fieldset>
    <select name="ext">
    <option>.com</option>
    <option>.net</option>
    <option>.org</option>
    <option>.us</option>
    <option>.info</option>
    <option>.biz</option>
    <option>.mobi</option>
    <option>.name</option>
    <option>.tv</option>
    <option>.me</option>        
    </select>
    </fieldset>

    <input type="submit" value="Go">
    </form>

This selectbox enables to select only one option.

What I want is Forced selection in hidden / backend for the first 5 options regardless user select it or not.

How can I achieve this using JavaScript OR JQuery ?

Thanks.

  • 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-15T16:24:06+00:00Added an answer on May 15, 2026 at 4:24 pm

    Since you are using PHP you can try this:

    <form action="/domainchecker.php" method="post">    
    <input type="hidden" name="ext[]" value=".com">
    <input type="hidden" name="ext[]" value=".net">
    <input type="hidden" name="ext[]" value=".org">
    <input type="hidden" name="ext[]" value=".us">
    <input type="hidden" name="ext[]" value=".info">
    <input type="text" name="domain" size="20">
    
    <fieldset>
    <select name="ext[]">
    <option>.com</option>
    <option>.net</option>
    <option>.org</option>
    <option>.us</option>
    <option>.info</option>
    <option>.biz</option>
    <option>.mobi</option>
    <option>.name</option>
    <option>.tv</option>
    <option>.me</option>        
    </select>
    </fieldset>
    
    <input type="submit" value="Go">
    </form>
    

    Note the brackets in the fields’ names. In your PHP script you’ll need something like:

    $extensions = $_POST['ext'];
    foreach ($extensions as $ext) {
        #do something
    }
    

    Note that the $extensions array will contain duplicates if the user selected one of the first 5 entries in the dropdown.

    You can also use checkboxes instead of a dropdown like this:

    <form action="/domainchecker.php" method="post">    
    <input type="text" name="domain" size="20">
    
    <fieldset>
    <input type="checkbox" name="ext[]" value=".com" selected="true">
    <input type="checkbox" name="ext[]" value=".net" selected="true">
    <input type="checkbox" name="ext[]" value=".org" selected="true">
    <input type="checkbox" name="ext[]" value=".us" selected="true">
    <input type="checkbox" name="ext[]" value=".info" selected="true">
    <input type="checkbox" name="ext[]" value=".biz">
    <input type="checkbox" name="ext[]" value=".mobi">
    <input type="checkbox" name="ext[]" value=".name">
    <input type="checkbox" name="ext[]" value=".tv">
    <input type="checkbox" name="ext[]" value=".me">
    </select>
    </fieldset>
    
    <input type="submit" value="Go">
    </form>
    

    The PHP is the same, without the duplicate issue

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

Sidebar

Related Questions

If I have a form like this: <form action= method=post> <select id=links name=links> <option
I have a form that looks something like this: <form id=uploadForm name=uploadForm method=post enctype=multipart/form-data>
I have this input field: <form:input path=deliveryAddressFirstName id=deliveryAddressFirstName cssClass=text cssErrorClass=error/> When an error during
This is quite the pickle... I have a regular HTML form with a couple
I have a regular expression to validate a input value. At this point I
I have a select list like such: <select name=taxonomy[1][] multiple=multiple class=form-select id=edit-taxonomy-1 size=7> <option
I have an MVC action on my abstract BaseControlller like this (and this action
I have a regular form with a url as action to which the form
I have a situation like this. <php> <redirect the page > <exit> <javascript> <redirect
I have a regular expression to validate the dates and it works fine, this

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.