Avatar of Valleriani
Valleriani
Flag for Sweden asked on

Dropdown box to change textbox?

Right now I'm using basic html, but using javascript would be fine, except I haven't really dont much JS in the past.

Lets say I have this:

<th><span class="wsp_required">+</span>Telephone<span> </span><span> </span><span> </span></th>
<td><div class=inputTextFiller><input class="inputTextLeft" type="text" name="fld14_1" id="fld14_1" value="" style="width:30px" maxlength=\"3\" /> <span> -</span>
<input class="inputTextLeft" type="text" name="fld14_2" id="fld14_2" value="" style="width:30px" maxlength=\"3\" /> <span> -</span>
<input class="inputTextLeft" type="text" name="fld14_3" id="fld14_3" value="" style="width:40px" maxlength=\"4\" /></div></td>


What this is, is a 3 box telephone inputbox. It works fine for general usage, but EU members have trouble.  I was wondering how I could create it so that there is a dropdown box beside this that has the two options in it: "USA" and "OTHER". When selecting OTHER, the 3 inputboxes above would become one large inputbox, and selecting USA would bring back the above 3 inputboxes.

Is this possible? If so, how can it be done with javascript (or something else while using a .html file)

Thanks!
JavaScriptHTMLAJAX

Avatar of undefined
Last Comment
OmniUnlimited

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
OmniUnlimited

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
OmniUnlimited

You can download jQuery at http://jquery.com/
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23