[Javascript] FW: Severe 'newbie' help with checkbox/submit

uplate at attbi.com uplate at attbi.com
Wed Apr 23 13:57:08 CDT 2003


Hi Pat I don't know if this would help,
Here's an HTML DOC that uses a radio group to accomplish what you want:
You may have to correct some text wrapping.
*****************PASTE TEXT BELOW THIS LINE INTO HTML DOC***********************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Open URLS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
var myURL;
function setVar(val)
{
	myURL = val;
}

function openURL()
{
	var newWin = window.open(myURL,"","");
}
//-->
</script> 
</head>
<body>
<form name="form1" method="post" action="">
<table width="200">
  <tr>
    <td><label>
      <input type="radio" name="myURLS" onClick="setVar('http://www.ebay.com')">
      EBay</label>
    </td>
  </tr>
  <tr>
    <td><label>
      <input type="radio" name="myURLS" onClick="setVar
('http://www.foxnews.com')">
      Fox</label>
    </td>
  </tr>
</table>
  <input type="button" name="Submit" value="Submit" onClick="openURL()">
  </p>
</form>
</body>
</html>
**************************End Of HTML DOC***************************
> This may be the wrong list to send this request to, but perhaps it is and I
> could use all the help I can get!  Perhaps JavaScript can provide a
> solution!
> 
> > I have a page from which I'd like to establish functionality to enable
> > URLs to be activated when submit button pressed.  Which URL would be
> > activated would be dictated by which checkbox is checked.
> > 
> > This should be a common task and I'm new at this.  I'm a bit embarassed
> > with my code because it so blatently doesn't work.   Can anyone help?
> > 
> > Thanks.
> > Pat Gorden-Ozgul
> > pgo at bnl.gov
> > 
> > 
> > 
> > *************example code snippet from
> > Response.asp************************
> > 
> > <p align="left">What action would you like to take?<br><br>
> > 	<input name="action1" type=checkbox value="ON">Create a New
> > Submission <br>
> > 	<input name="action2" type=checkbox value="ON">Modify a Previous
> > Submission <br>
> > </p>
> > 	<input type=submit value="Submit">
> > 	
> > 	
> > <%
> > if request("action1") = ""
> > 'checkbox is not selected

> > else
> > 'checkbox is selected
> > %>
> > <form method="post" action"http:://directory/first.htm">
> > 
> > </form>
> > <%
> > end if
> > %>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list