Connecting Tech Pros Worldwide Forums | Help | Site Map

problem with radio buttons

Banned
 
Join Date: Mar 2008
Posts: 4
#1: Mar 31 '08
Hi,


I run the below code like i have two radio buttons. one is automatic,another is manual button.when i select the the automatic radio button it move to the page.php and select the manual radio button it move to the page2.php.But it is not work.plz tell that what's the problem in my code.


[HTML] <html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function showList() {
sList = window.open("page.php", "update");
}
function show() {
sList = window.open("page2.php", "update");
}
function remLink() {
if (window.sList && window.sList.open && !window.sList.closed)
window.sList.opener = null;
}
</SCRIPT>
</head>
<body>
<form action=link method="reg_updated_msg.html" name="stockForm">
<input type="radio" name="stockBox" onClick="showList(this.value)" checked id="id11" value=""/> Automatic registration approval via
email<br>
<input type="radio" name="stockBox" onClick="show(this.value)"id="id22"/> Manual registration approval by
administrator<br>
</form>
</body>
</html>[/HTML]

Member
 
Join Date: Dec 2007
Posts: 66
#2: Mar 31 '08

re: problem with radio buttons


Quote:

Originally Posted by pavani1

Hi,


I run the below code like i have two radio buttons. one is automatic,another is manual button.when i select the the automatic radio button it move to the page.php and select the manual radio button it move to the page2.php.But it is not work.plz tell that what's the problem in my code.


[HTML] <html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function showList() {
sList = window.open("page.php", "update");
}
function show() {
sList = window.open("page2.php", "update");
}
function remLink() {
if (window.sList && window.sList.open && !window.sList.closed)
window.sList.opener = null;
}
</SCRIPT>
</head>
<body>
<form action=link method="reg_updated_msg.html" name="stockForm">
<input type="radio" name="stockBox" onClick="showList(this.value)" checked id="id11" value=""/> Automatic registration approval via
email<br>
<input type="radio" name="stockBox" onClick="show(this.value)"id="id22"/> Manual registration approval by
administrator<br>
</form>
</body>
</html>[/HTML]

I don't think there is any error in your code.
Check the location of the file that you are giving in window.open().
And what is the use of fucntion remLink() it is not used in code.
Familiar Sight
 
Join Date: Oct 2006
Posts: 141
#3: Mar 31 '08

re: problem with radio buttons


Hi,

ur code is working but the problem is when page is loaded the automatic check box is checked so instead making it checked make is unchecked or
on loading since it is checked open that window.
Reply