Take the 2-minute tour ×

I have a signup form that takes names from a table of previous participants. This way when someone wants to register for another squad in the same or in an upcoming tournament, all they have to do is select their name and autofill will provide their USBC numbers and Date of Birth. I have achieved this for one bowler. Problem is that the tournament is a doubles tournament.

I have tried a separate function with a different name for the second bowler, which did not work. I tried to send to the autofill function a number to use in an if statement to determine which sets of text boxes should receive the information. I have tried searching for previous requests for help and have either not asked the right question to Google or else this is so easy that nobody else has had to ask for help with it. If I change the code in the autofill function to inputString2, usbc_no2 and dob2, autofill places the data into the correct text boxes.

Here is the code for the autofill:

function fill(thisValue) {


and here is the code for the bowler 1's information:

*Full Name:

and the code for bowler 2's information:

                                                    <label for="name"><strong>*</strong>Full Name:</label>
                                                    <input type="text" id="inputString2" value="" onkeyup="lookup(this.value);" onblur="fill();" class="input_field bowler_info" name="cname2" />

This can be seen in real time at http://hammerpins.net/testsignup_HP.php?eid=367&squads=2 and type D. Did I do this right? Thanks for your help.

share|improve this question
What is your problem ? –  genesis Jun 16 '11 at 14:18
@genesis: my basic problem is how do I go about modifying the fill function dependent upon which bowler I am trying to get the information for. For example, the fill code as in the question will put the appropriate data into the bowler 1 textboxes. However, when I tab over to complete the data for bowler 2, fill overwrites whatever is in the bowler 1 boxes. I can manually force the fill function to put the data in the bowler 2 textboxes, but cannot figure out how to do this automatically. –  Dennis Emory Jun 16 '11 at 15:06
As I still haven't found a proper way that works to accomplish what I am after, I ended up doubling both functions - lookup and lookup2, and fill and fill2. I will continue to strive to figure out how to do this with less code, but until that time, my way works for now. –  Dennis Emory Aug 1 '11 at 14:36
add comment


Your Answer



Browse other questions tagged or ask your own question.