Input data for EIN or SS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vrkamalakar
    New Member
    • Jan 2007
    • 16

    #1

    Input data for EIN or SS

    Hi,

    In my JSP page I have to take an input for either Social Security Number for which the format is 999-99-9999 or Employee Identification Number for which the format is 99-9999999. Now it is not know which one the user is going to enter. He has to enter only one field ie., either SSN or EIN.

    So I have 3 text boxes for SSN and 2 text boxes for EIN. How should I name them. Because in the Action Form only one property is used.

    If the user enters SSN then all the values in the 3 text boxes have to be concatenated and passed to the variable in Action Form. If the user enters EIN the the values in 2 text boxes have to be concatenated and passed to the same variable in the Action Form. Can anyone suggest. Also if the user is entering SSN......when he enters the first 3 digits in the first text box...automatic ally the focus have to move to the second text box.

    Regards,
    Kamal
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by vrkamalakar
    Hi,

    In my JSP page I have to take an input for either Social Security Number for which the format is 999-99-9999 or Employee Identification Number for which the format is 99-9999999. Now it is not know which one the user is going to enter. He has to enter only one field ie., either SSN or EIN.

    So I have 3 text boxes for SSN and 2 text boxes for EIN. How should I name them. Because in the Action Form only one property is used.

    If the user enters SSN then all the values in the 3 text boxes have to be concatenated and passed to the variable in Action Form. If the user enters EIN the the values in 2 text boxes have to be concatenated and passed to the same variable in the Action Form. Can anyone suggest. Also if the user is entering SSN......when he enters the first 3 digits in the first text box...automatic ally the focus have to move to the second text box.

    Regards,
    Kamal
    Solve all these problems using javascript. Call the textboxes whatever you want. Call a javascript function onSubmit of the form.
    The function sets the value of the variable to be submitted based on the conditions.

    For the focus change you call another javascrit function onChange of the textbox which sets focus to the next box if input entered is 3 characters long (may also consider fixing the sizes of these textboxes to 3)

    Comment

    • horace1
      Recognized Expert Top Contributor
      • Nov 2006
      • 1510

      #3
      Originally posted by vrkamalakar
      Hi,

      In my JSP page I have to take an input for either Social Security Number for which the format is 999-99-9999 or Employee Identification Number for which the format is 99-9999999. Now it is not know which one the user is going to enter. He has to enter only one field ie., either SSN or EIN.

      So I have 3 text boxes for SSN and 2 text boxes for EIN. How should I name them. Because in the Action Form only one property is used.

      If the user enters SSN then all the values in the 3 text boxes have to be concatenated and passed to the variable in Action Form. If the user enters EIN the the values in 2 text boxes have to be concatenated and passed to the same variable in the Action Form. Can anyone suggest. Also if the user is entering SSN......when he enters the first 3 digits in the first text box...automatic ally the focus have to move to the second text box.

      Regards,
      Kamal
      would it be simpler (both for you and the user) to have a single text box - you can then examine the input string to see if matches an SSN or EIN anything else being an error?

      Comment

      • vrkamalakar
        New Member
        • Jan 2007
        • 16

        #4
        Hi,
        Thanks for your reply..but can you please write some code for concatenating the values and assigning to the variable in the Action Form. Iam relatively new to this technology. Thanks a lot...

        Regards,
        Kamal.

        Originally posted by r035198x
        Solve all these problems using javascript. Call the textboxes whatever you want. Call a javascript function onSubmit of the form.
        The function sets the value of the variable to be submitted based on the conditions.

        For the focus change you call another javascrit function onChange of the textbox which sets focus to the next box if input entered is 3 characters long (may also consider fixing the sizes of these textboxes to 3)

        Comment

        • vrkamalakar
          New Member
          • Jan 2007
          • 16

          #5
          Requirements cannot be changed....

          Regards,
          Kamal.


          Originally posted by horace1
          would it be simpler (both for you and the user) to have a single text box - you can then examine the input string to see if matches an SSN or EIN anything else being an error?

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Originally posted by vrkamalakar
            Hi,
            Thanks for your reply..but can you please write some code for concatenating the values and assigning to the variable in the Action Form. Iam relatively new to this technology. Thanks a lot...

            Regards,
            Kamal.
            Are you new to Javascript as well? I said this can be done in Javascript.

            to concatenate 2 strings s1 and s2 in Javascript,
            do
            Code:
             s3 = s1 + s2;

            Comment

            • vrkamalakar
              New Member
              • Jan 2007
              • 16

              #7
              Thanks a lot...

              Regards,
              Kamal

              Originally posted by r035198x
              Are you new to Javascript as well? I said this can be done in Javascript.

              to concatenate 2 strings s1 and s2 in Javascript,
              do
              Code:
               s3 = s1 + s2;

              Comment

              Working...