Adding custom js function to field in sugarCRM

Discussion in 'JavaScript' started by stephan2307, Dec 12, 2012.

  1. #1
    Hi,

    I am trying to add some custom functions to name and phone number fields. I have written the functions and saved them in a js file and added the js file to the pages. Now I am trying to add a onkeyup action to the desired fields. Not sure how I can do this.

    At the moment I am using the standard free edition and am looking at the Office phone number on the Create Contact page.

    Can anyone help?
     
    stephan2307, Dec 12, 2012 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    "Field" refers to something in a database, which would be on the server. Javascript runs in the browser. Do you mean the name and phone number elements?
     
    Rukbat, Dec 12, 2012 IP
  3. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #3
    yes. basically I want to change ++41 to 0041 and on the names I want to change it to the correct upper and lower cases.
     
    stephan2307, Dec 12, 2012 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    In the database or in the browser?
     
    Rukbat, Dec 12, 2012 IP
  5. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #5
    browser. I want to enforce a certain format when people enter the information.
     
    stephan2307, Dec 12, 2012 IP
  6. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #6
    ok managed to do it.
     
    stephan2307, Dec 12, 2012 IP