locked
Force Uppercase RRS feed

  • Question

  • I have a field called "Serial Number" it can be a combination of numbers and letters totaling 17 characters.

    How do I force the 17 characters and force the letters to be capitals. 
    Wednesday, October 14, 2009 12:42 PM

Answers

  • Hi.

    Add following script to serial number field onChange event handler:

    if (crmForm.all.<serial number field>.DataValue != null)
    crmForm.all.<serial number field>.DataValue = crmForm.all.<serial number field>.DataValue.toUpperCase();
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    • Proposed as answer by Mayank PujaraEditor Wednesday, October 14, 2009 12:50 PM
    • Marked as answer by j_ttc Wednesday, October 14, 2009 1:49 PM
    Wednesday, October 14, 2009 12:49 PM
    Moderator
  • I don't understand what you mean. Could you give some sample?

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    • Marked as answer by j_ttc Wednesday, October 14, 2009 1:49 PM
    Wednesday, October 14, 2009 1:29 PM
    Moderator
  • Hi.

    You can make following:

    1. Set this field as a required
    2. Add following code to OnChange eventHandler:

    if (crmForm.all.<serial number field>.DataValue != null)
    {
    if (crmForm.all.<serial number field>.DataValue.lenght < 17)
    {
    alert('Input all 17 characters');
    crmForm.all.<serial number field>.SetFocus();
    }
    else
    crmForm.all.<serial number field>.DataValue = crmForm.all.<serial number field>.DataValue.toUpperCase();
    }
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    • Marked as answer by j_ttc Wednesday, October 14, 2009 1:49 PM
    Wednesday, October 14, 2009 1:40 PM
    Moderator
  • Thankyou very much !!!

    • Marked as answer by j_ttc Wednesday, October 14, 2009 1:49 PM
    Wednesday, October 14, 2009 1:49 PM

All replies

  • Hi.

    Add following script to serial number field onChange event handler:

    if (crmForm.all.<serial number field>.DataValue != null)
    crmForm.all.<serial number field>.DataValue = crmForm.all.<serial number field>.DataValue.toUpperCase();
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    • Proposed as answer by Mayank PujaraEditor Wednesday, October 14, 2009 12:50 PM
    • Marked as answer by j_ttc Wednesday, October 14, 2009 1:49 PM
    Wednesday, October 14, 2009 12:49 PM
    Moderator
  • I did this and it worked great for the upper case ....how can I force it to 17 characters?

    Wednesday, October 14, 2009 1:17 PM
  • I don't understand what you mean. Could you give some sample?

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    • Marked as answer by j_ttc Wednesday, October 14, 2009 1:49 PM
    Wednesday, October 14, 2009 1:29 PM
    Moderator
  • The filed length is 17 and a Serial Number is 17 charachters ..example Serial Number is <1FUJGLDR8ALAR0861> ... if it isn't 17 caharacters the information would be wrong and I want to force them to make sure the put all the characters in before moving on to the next field. 

    Thanks for you assistance
    Wednesday, October 14, 2009 1:36 PM
  • Hi.

    You can make following:

    1. Set this field as a required
    2. Add following code to OnChange eventHandler:

    if (crmForm.all.<serial number field>.DataValue != null)
    {
    if (crmForm.all.<serial number field>.DataValue.lenght < 17)
    {
    alert('Input all 17 characters');
    crmForm.all.<serial number field>.SetFocus();
    }
    else
    crmForm.all.<serial number field>.DataValue = crmForm.all.<serial number field>.DataValue.toUpperCase();
    }
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    • Marked as answer by j_ttc Wednesday, October 14, 2009 1:49 PM
    Wednesday, October 14, 2009 1:40 PM
    Moderator
  • Thankyou very much !!!

    • Marked as answer by j_ttc Wednesday, October 14, 2009 1:49 PM
    Wednesday, October 14, 2009 1:49 PM