/    Sign up×
Community /Pin to ProfileBookmark

radio button content switching

I found this script to change an image based on the radio button selected:

<FORM action=”” method=post>
<TABLE cellSpacing=0 cellPadding=0 width=429 border=0>
<TBODY>
<TR>
<TD><INPUT onclick=”document.images[‘rx-78-2’].src=(this.value)” type=radio CHECKED value=a.jpg name=rx-78-2> </TD>
<TD><INPUT onclick=”document.images[‘rx-78-2’].src=(this.value)” type=radio value=b.jpg name=rx-78-2> </TD></TR>
<TR vAlign=top>
<TD>
1</TD>
<TD>
2</TD></TR></TBODY></TABLE></FORM></DIV>
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 width=429 border=0>
<TBODY>
<TR>
<TD>
<DIV align=center><IMG height=400 alt=”” src=”us-add.php” width=400 border=0 name=rx-78-2></DIV></TD></TR></TBODY></TABLE>

How do I use radio buttons to display different sets of form fields within a larger form on a page? Instead of switching images, I want to switch HTML code.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @tachyon 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.15,
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,
)...