/    Sign up×
Community /Pin to ProfileBookmark

form item lookup

Hi everyone,

I have a form where the top row of input boxes are blank
the ones below have a radio button next to them
and are populated with data

I want to click on the radio button and depending on which row the radio button is it will populate the top row with the data in that row.
The for will be created through ASP so I have to programmatically get the references for the fields that contain the data. I dont know how to do that. Can anyone help?

This is an example of what it will look like:

<form>
<table>
<tr><td>
</td><td>
<input type=text name=fname>
</td><td>
<input type=text name=lname>
</td></tr>

<tr><td>
<input type=radio name=radioset value=1>
</td><td>
<input type=text name=fname1 value=”Homer”>
</td><td>
<input type=text name=lname1 value=”Simpson”>
</td></tr>

<tr><td>
<input type=radio name=radioset value=2>
</td><td>
<input type=text name=fname2 value=”Eric”>
</td><td>
<input type=text name=lname2 value=”Cartman”>
</td></tr>

</table>
</form>

Much obliged,
Lev

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@CyCoSep 10.2004 — ...something like this...?
[CODE]
<form>
<table>
<tr><td>
</td><td>
<input type=text name=fname>
</td><td>
<input type=text name=lname>
</td></tr>

<tr><td>
<input type=radio name=radioset value=1 onclick="this.form.fname.value = this.form.fname1.value; this.form.lname.value = this.form.lname1.value">
</td><td>
<input type=text name=fname1 value="Homer">
</td><td>
<input type=text name=lname1 value="Simpson">
</td></tr>

<tr><td>
<input type=radio name=radioset value=2 onclick="this.form.fname.value = this.form.fname2.value; this.form.lname.value = this.form.lname2.value">
</td><td>
<input type=text name=fname2 value="Eric">
</td><td>
<input type=text name=lname2 value="Cartman">
</td></tr>

</table>
</form>
[/CODE]
×

Success!

Help @jawbones spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...