Avatar of Valleriani
VallerianiFlag 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
ASKER CERTIFIED SOLUTION
Avatar of OmniUnlimited
OmniUnlimited
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
You can download jQuery at http://jquery.com/
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo