Hi all,
I wanted to find out something.
If you have an input box on an html form and you wanted it to operate as follows.
It will be used to enter a phone number with no dashes. The phone number can have 10,11,even 15 digits(different parts of the world).
I wanted the input box to have the digits 1868 in the beginning of the box and let the curser be after the last 8 digit when the box gets focus so that the user could enter the other numbers after 1868 for local calls.Otherwise, The user could press backspace and delete the 1868 digits for international calls and type the entire international call number.
Is this possible at all?
6 1582
Hi all,
I wanted to find out something.
If you have an input box on an html form and you wanted it to operate as follows.
It will be used to enter a phone number with no dashes. The phone number can have 10,11,even 15 digits(different parts of the world).
I wanted the input box to have the digits 1868 in the beginning of the box and let the curser be after the last 8 digit when the box gets focus so that the user could enter the other numbers after 1868 for local calls.Otherwise, The user could press backspace and delete the 1868 digits for international calls and type the entire international call number.
Is this possible at all?
Well, one thing you could do is give your input box a pre-defined "value" using the value option to the input tag. This way, as you wanted, if it is to be different, then the user could just delete it.
Regards,
Jeff
As for the curser appearing after the last digit when the page is loaded.
Well i'm not entirely sure if you can do this or not. You can't in HTML, and CSS that's for sure, however, it may be possible in JavaScript so I would ask over there.
Hope it helps, Thanks, Death
Hi Death Slaught,
Thanks for your suggestion,
One thing though, I didnt want the curser to be after the 1868 when the page loads. I want it to be after the 1868 when the text box recieves focus.
Any suggestions?
Hi Death Slaught,
Thanks for your suggestion,
One thing though, I didnt want the curser to be after the 1868 when the page loads. I want it to be after the 1868 when the text box recieves focus.
Any suggestions?
Same as before ask in the JavaScript forum.
Thanks, Death
Hi all,
I wanted to find out something.
If you have an input box on an html form and you wanted it to operate as follows.
It will be used to enter a phone number with no dashes. The phone number can have 10,11,even 15 digits(different parts of the world).
I wanted the input box to have the digits 1868 in the beginning of the box and let the curser be after the last 8 digit when the box gets focus so that the user could enter the other numbers after 1868 for local calls.Otherwise, The user could press backspace and delete the 1868 digits for international calls and type the entire international call number.
Is this possible at all?
See this thread.
That would give you the cursor position. You can set the cursor position too.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Christopher R. Barry |
last post by:
I need to search and replace multiple words in one pass of an input
stream or string. For example, given the input:
"The quick brown fox jumped over the lazy dog's back"
and given the...
|
by: Aleks Dubinskiy |
last post by:
Hi folks,
I am well aware of the superiority of using streams and operators << / >>
instead of the old-style printf and scanf. However, there is only one
obstacle that prevents me from switching...
|
by: Corepaul |
last post by:
As input is typed into a text box, I would like to search a recordset for the
first record that matches what has been typed so far. I would like to update
the text box to display the letters typed...
|
by: Eric Lilja |
last post by:
Hello, consider the following complete program:
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
static int...
|
by: JJ |
last post by:
Is it possible to count the number of columns that match certain conditions
and return a single value?
For example in the database we have a record where:
Column 1 = Male
Column 2 = A
Column...
|
by: neelay1 |
last post by:
Hi all,
I have a Javascript variable that contains the name of a form input-
input_name = "document.myform.ip"
How can I get the value of this form input, "ip" using the variable
input_name?...
|
by: Trev |
last post by:
Hi everyone,
I'm having some problems with my regular expressions in C# and was
wondering if anyone could help?
Basically, what I'm trying to do is check for numerical only input -
either...
|
by: pld888 |
last post by:
https://turbotaxweb.turbotaxonline.intuit.com/open/registration/SignIn.htm
anyone know which 3rd party textbox this is???
|
by: cront |
last post by:
I have a problem to work on:
we will ask user to input anything and we will put that back onto the
standard output with all set of brackets removed. We will not remove any
single bracket e.g.
...
|
by: =?Utf-8?B?QWFyb24=?= |
last post by:
Hi,
I'm having a tricky problem where I want to accept a regular expression
pattern from user input but can't get teh escape characters to be prcoessed
correctly. If I take the same pattern and...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |