473,405 Members | 2,282 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,405 software developers and data experts.

OnFocus Problem in Javascript

57
i use php,mysql & javascript for this project.

i use textbox for phone. i use 11 digit for that. first 3 digit(017) fixed for that.when cursor focus that field auto 017 set there. don't delete or insert another digit for that 017 digit. please help me..............

my problem:
Expand|Select|Wrap|Line Numbers
  1. <input type="text" name="phone" id="phone" onFocus="this.value='017'" value="" size="20" maxlength="11" />
Apr 17 '08 #1
3 1387
gits
5,390 Expert Mod 4TB
why don't just use a readonly textbox here? like:

[HTML]<input type="text" name="your_field_name" size="4" value="017" readonly="readonly"/>
<input type="text" name="phone" id="phone" size="20" maxlength="11"/>[/HTML]
kind regards
Apr 17 '08 #2
Noorain
57
why don't just use a readonly textbox here? like:

[HTML]<input type="text" name="your_field_name" size="4" value="017" readonly="readonly"/>
<input type="text" name="phone" id="phone" size="20" maxlength="11"/>[/HTML]
kind regards

thanks.
now how to add 2 textbox value in one textbox.please tell me.....
Apr 17 '08 #3
gits
5,390 Expert Mod 4TB
thanks.
now how to add 2 textbox value in one textbox.please tell me.....
whatfor? just use 2 textboxes or use css to make them appear as one ...

kind regards
Apr 17 '08 #4

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

Similar topics

2
by: Mike Berger | last post by:
So, I'm fairly new to this and my code is as follows... <script language="JavaScript> var oldValue function focusElement(theElement) { oldValue = theElement.value; return; } </script>
4
by: Scott Navarre | last post by:
Hi, I have Red Hat 8.0 and have the default Mozilla browser that comes with it. I am programming in javascript and have come across something problematic. Given the following code: <HTML>...
1
by: Michael Albanese | last post by:
I am developing an application to handle my compay's OSHA reporting requirements. Some of the input criteria are technical and narowly defined, so I was trying to prvide what i call "Context...
2
by: swathi | last post by:
----------------------------------------------------------------------- A poll associated with this post was created, to vote and see th results, please visit...
2
by: Don | last post by:
What does the onfocus value of "this.select()" do in the following <input...> tag? <input type=text name="img" size=20 onfocus="this.select()" value="http://" tabindex=7> Thanks, Don ...
3
by: the good guy | last post by:
For those who have been using Outlook Express, you must be pretty used to the fact that whenever you focus on the preview section, the header for the preview turns from grey to blue, while the text...
1
by: Eric Trav | last post by:
Hello, I am using mozilla and javascript to change the style background color for my select with onfocus() and back to white with onblur(). When i process onfocus(); i have to click on the...
5
by: Max | last post by:
I've got a default value of some text in an input element when a page loads. What I'd like to do is have the value disappear when the user clicks in the input field. I've figured out I can use:...
1
by: partlocator | last post by:
I'm checking on some code my developer did for a form on our site. The code relates to a submit button and I'm not sure if it's functioning properly. I ran the javascript through...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.