OnFocus Problem in Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Noorain
    New Member
    • Mar 2008
    • 57

    OnFocus Problem in Javascript

    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:
    [CODE=html]<input type="text" name="phone" id="phone" onFocus="this.v alue='017'" value="" size="20" maxlength="11" />[/CODE]
    Last edited by gits; Apr 17 '08, 08:25 AM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    why don't just use a readonly textbox here? like:

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

    Comment

    • Noorain
      New Member
      • Mar 2008
      • 57

      #3
      Originally posted by gits
      why don't just use a readonly textbox here? like:

      [HTML]<input type="text" name="your_fiel d_name" size="4" value="017" readonly="reado nly"/>
      <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.....

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        Originally posted by Noorain
        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

        Comment

        Working...