Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add radio button values and forward to 4 options

Status
Not open for further replies.

wrmedia

Technical User
Jun 6, 2002
19
US
have a page with 28 radio buttons (7 rows of 4)

each has a value associated with it from 1 to 7

user picks one choice from each row

need to add these 4 choices and depending on total on submit will move to one of 4 pages

obviously the minimum total is 4 and the maximum is 28

so total of 4 to 9 forwards to one.html
so total of 10 to 15 forwards to two.html
so total of 16 to 21 forwards to three.html
so total of 22 to 28 forwards to four.html

thanks
 
So you have form where the action attribute may have 1 of 4 values? Something along the lines of
Code:
<script language="JavaScript1.1">
function submitForm(f)
{
  if (total >=4 && total <=9)
  {
    f.action = "one.htm":
  }
  else
  if (total >= 10 && total <= 15)
  {
    f.action = "two.html"
  }
  .
  .
  etc
  .
  .
  f.submit();
}

blah
blah
blah

<form id="myForm" onsubmit="submitForm(this)" method="post">
form stuff here
</form>
Maybe better to use "switch" but I can't remember the syntax off hand.

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top