...

View Full Version : Radio Button



madhoriya22
07-20-2007, 11:42 AM
:) Hi,
I have radio buttons on HTML page. How can I process my request on just clicking the radio button........I am not using java script......I have tried onclick and onselect attributes............but they are only meant for scripts......Can I put the radio button in hyper link.........any help !!!!

Blekk
07-20-2007, 12:24 PM
Well you will need to use some server-side scripting such as PHP or Perl. You would do this like:

First Page:

<form action="page2.php" method="post">
<input type="radio" name="myradio" /> My Radio Button
<input type="submit" value="Submit" />
</form>

Second Page:

<?php
$Myradiobutton = $_POST['myradio'];
if($Myradiobutton == 'checked')
{
print "This radio is checked.";
}
?>

You can do it with other languages too, this is just in php.

Hope it helps.

madhoriya22
07-20-2007, 01:33 PM
Well you will need to use some server-side scripting such as PHP or Perl. You would do this like:

First Page:

<form action="page2.php" method="post">
<input type="radio" name="myradio" /> My Radio Button
<input type="submit" value="Submit" />
</form>

Second Page:

<?php
$Myradiobutton = $_POST['myradio'];
if($Myradiobutton == 'checked')
{
print "This radio is checked.";
}
?>

You can do it with other languages too, this is just in php.

Hope it helps.


I am already using JSP as server side language.....Is there any way I can do it in JSP.......I cant use JavaScript !!

saeed
07-20-2007, 01:37 PM
hello madhoriya22,
I donno wht exactly u're tryin to do ....

instead of page2.php in the above code write yourJSPfilename.jsp

and rest of the code in your JSP page thts it.

tht will do ... i guess. :rolleyes:


Saeed

rmedek
07-20-2007, 05:41 PM
Just curious, but why can't you use Javascript? This sort of thing is precisely the time and reason to use Javascript.

Also, Blekk, I'm pretty sure that method wouldn't work as the page would still need to be submitted before PHP (or JSP) could check to see if the radio button was checked.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum