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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:27:28+00:00 2026-05-14T21:27:28+00:00

I have the following <select> in a form: <select style=width: 100px; text-align: center;> <option

  • 0

I have the following <select> in a form:

<select style="width: 100px; text-align: center;">
  <option value="email">Email</option>
  <option value="telephone">Phone</option>
</select>

The default option is Email so the following <input> is show:

<p class="email_form">Please supply your Email Address</p>
<input onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;" style="width: 270px" type="email" name="email" id="email" value="jose.gonzalez@hotmail.com">

However if they choose telephone I want to change the above to ask for a telephone number?

  • 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-14T21:27:28+00:00Added an answer on May 14, 2026 at 9:27 pm

    Fastest way would be to give the ‘label’ paragraph a (more generic) ID, and:

    <p id="contact_method">Please supply your Email Address</p>
    
    document.getElementById("selectId").onchange = function() {
        var value = this.options[this.selectedIndex].value;
        var p = document.getElementById("contact_method");
        if(value == 'telephone') {
            p.innerHTML = 'Please supply your phone number';
        } else {
            p.innerHTML = 'Please supply your email address';
        }
    }
    

    Try it out here: http://jsfiddle.net/29w2G/

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

Sidebar

Related Questions

i have following filteringselect: <select name=v dojoType=dijit.form.FilteringSelect valueList=v id=v value=0><option value=></option><option value=0>0-test</option><option value=1>1-test2/option><option value=2>2-test3</option><option
I have the following markup: <select multiple=multiple id=targetFilesList style=width:200px;height:110px;> </select> <input type=button value=Get id=btnGet
I have the following multi-select box in a HTML form, where user can select
All, I have the following select: <select name=options_1 id=options_1 class=select_me> <option>1</option> <option>2</option> </select> I
I have the following form code but I cannot select the sell radio in
I have in my rails form the following code: <label>Fruit: </label> <%= f.select(:IST_FRUIT, [['Apple',
I have the following select field in a form: { xtype: 'selectfield', name: 'minprice',
I have following select results: Select t1.ID, t1.Value1 from t1 where t1.ID=1 Result: ID
Have the following select giving me the data I want, but I want to
i have the following select box and want to sort it by display:none inlne

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.