473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Input box match

69
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?
Dec 5 '07 #1
6 1582
numberwhun
3,509 Expert Mod 2GB
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
Dec 5 '07 #2
Death Slaught
1,137 1GB
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
Dec 5 '07 #3
phpmel
69
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?
Dec 6 '07 #4
Death Slaught
1,137 1GB
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
Dec 6 '07 #5
phpmel
69
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?
Dec 10 '07 #6
acoder
16,027 Expert Mod 8TB
See this thread.

That would give you the cursor position. You can set the cursor position too.
Dec 10 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
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...
10
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...
2
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...
13
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...
1
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...
6
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?...
9
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...
3
by: pld888 | last post by:
https://turbotaxweb.turbotaxonline.intuit.com/open/registration/SignIn.htm anyone know which 3rd party textbox this is???
13
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. ...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...
0
jinu1996
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...
0
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...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.