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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form element checking issue...please help!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I am building a form that has 2 radio buttons that are to trigger different action url's, depending on which button is selected.
So basically I figure I have to check the form elements and pass the correct action url.

Does anyone know how to do this with Javascript. I need code. Thanks much.
 
Hi
This is the code to open two diffrent URL based on selecting two diffrent radio button.I have attached two sets of code .Check which is more useful.I believe we can optimise this code by calling one function with arguments instead of two.
Anybody pls help in that :)

Regards
Sudha

<b>Code 1</b>
<HTML>
<HEAD>
<script language=&quot;javascript&quot;>
function fun1()
{
window.open('}
function fun2()
{
window.open('}
</script>

</HEAD>
<BODY>
<input type=&quot;radio&quot; name=&quot;rad&quot; value=&quot;rad1&quot; onclick =&quot;fun1()&quot;>Radio1
<input type=&quot;radio&quot; name=&quot;rad&quot; value=&quot;rad2&quot; onclick =&quot;fun2()&quot;>Radio2
</BODY>
</HTML>


<b>Code 2: </b>
<INPUT type=&quot;radio&quot; name =&quot;rad1&quot; value=&quot;New Window!&quot; onClick=&quot;window.open(' radio1
<INPUT type=&quot;radio&quot; name =&quot;rad1&quot; value=&quot;New Window1&quot; onClick=&quot;window.open(' radio2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top