Question
Input box to enter a phone number or a code Submit button Radio buttons to indicate what to enter US Phone number (xxx) xxx-xxxx FR
Input box to enter a phone number or a code
Submit button
Radio buttons to indicate what to enter
US Phone number (xxx) xxx-xxxx
FR Phone number xx.xx.xx.xx
US SS number xxx-xx-xxxx
Verify it is correct on Submit
Extra credit:
Use keyboard events to format the input as the number is typed
Allow user to hit
I can`t get the input to switch to display what radio button was clicked
essentially it should be able to receive input from the radio button and display which was clicked plus the input form
It should have a required pattern for the input and return a new format when you click the button. It should have a placeholder for example us (XXX)-XXX-XXX
There should also be a limit on the characters you can enter for each option and add in dashes or dots as the user inputs the numbers.
so far I have this :
function formatNums(){
if(document.getElementById('us').checked) {
document.getElementById('format').innerHTML = "US tel:" + " "+document.getElementById('forms').value
} else if (document.getElementById('fr').checked) {
document.getElementById('format').innerHTML = "FR tel:" + " "+document.getElementById('forms').value
} else if (document.getElementById('ssn').checked) {
document.getElementById('format').innerHTML = "US SS:" + " "+document.getElementById('forms').value
} else {
document
}
}
Enter your information? US Phone Number French phone number Social Security Number US Phone Number US tel: (123) 456-6789 Enter your information? US Phone Number French phone number Social Security Number French Phone Number FR tel: 12.34.56.78 Enter your information? US Phone Number French phone number Social Security Number US Social Security Number
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started