By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,736 Members | 1,982 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,736 IT Pros & Developers. It's quick & easy.

Input data for EIN or SS

P: 16
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...automatically the focus have to move to the second text box.

Regards,
Kamal
Jan 10 '07 #1
Share this Question
Share on Google+
6 Replies


10K+
P: 13,264
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...automatically 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)
Jan 10 '07 #2

Expert 100+
P: 1,510
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...automatically 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?
Jan 10 '07 #3

P: 16
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.

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)
Jan 10 '07 #4

P: 16
Requirements cannot be changed....

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?
Jan 10 '07 #5

10K+
P: 13,264
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
Expand|Select|Wrap|Line Numbers
  1.  s3 = s1 + s2;
Jan 10 '07 #6

P: 16
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
Expand|Select|Wrap|Line Numbers
  1.  s3 = s1 + s2;
Jan 10 '07 #7

Post your reply

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