/    Sign up×
Community /Pin to ProfileBookmark

Urgent: Making Text work like submit button

Hello: I’ve got this script that works fine – depending on the radio button, it redirects to the corresponding page to the radio button selected. It works with regular submit button and I need it for a css text button to instead work like submit button that calls the javascript to redirect on radio button selection.

However I need the script to work with a css text button.

Here’s the javascript function:

[code]
function radioRedirect(frm,nm){
for (var i_tem = 0,
coverage=frm.elements;
i_tem < coverage.length;
i_tem++)

if(coverage[i_tem].name==nm&&coverage[i_tem].checked)
frm.action=coverage[i_tem].value;
}

and the following is the form:

<!– form starts here –>
<form name=”frm” id=”frm” action=”#” onsubmit=”radioRedirect(this, ‘coverage’);”>

<input type=”radio” name=”coverage” value=”client_solicitation3.htm” />
<input type=”radio” name=”coverage” value=”client_solicitation3.htm” />

<input type=”radio” name=”coverage” value=”client_solicitation3.htm” />
<input type=”radio” name=”coverage” value=”client_solicitation3.htm” />
<input type=”radio” name=”coverage” value=”client_solicitation4.htm” />

<input type=”submit” value=”Go”> [redirects the pages fine]

<div class=”button_rightside”><a href=”#”>NEXT</a></div> [need this link to work like above ugly go button]

Thanks for your time and help
</form>[/code]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Angry_Black_ManMar 21.2008 — &lt;div style="cursor: pointer" onclick="radioRedirect(frm, 'coverage');frm.submit()"&gt;NEXT&lt;/div&gt;
Copy linkTweet thisAlerts:
@balushahiauthorMar 21.2008 — Thanks Aaron for your help. I truly appreciate your quick response. I'll try it and let you know how it went ? ... thanks again for your time.
Copy linkTweet thisAlerts:
@balushahiauthorMar 21.2008 — Perfect ? thanks again for your help. Yay! it works. take care B
×

Success!

Help @balushahi 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 4.30,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...