It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

SUBMIT button adapted RADIO option

SUBMIT button adapted RADIO option

Postby Nothing2Lose on Tue May 03, 2005 3:35 am

Hi,

How can I make one SUBMIT button do submition upon one of two RADIOs button option? plz check this illu for more inof. ;)

Regards,
Last edited by Nothing2Lose on Tue May 10, 2005 8:19 am, edited 1 time in total.
Nothing2Lose
 
Posts: 28
Joined: Fri Apr 08, 2005 7:26 am

Postby webmaster on Tue May 03, 2005 5:52 am

That I don't know but I would do like this:
Code: Select all
<?
if($_POST['radioname'] == "create") {
   include "create.php";
} elseif ($_POST['radioname'] == "join") {
   include "join.php";
}
?>

By the way, it good that you show with pictures, much easier to understand your questions then =)
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby Nothing2Lose on Tue May 03, 2005 6:12 am

Thanx webmaster :)

your solution is really helpful, it works only with PHP.

I prefered if I got JavaScript soultion so the user input will validated before sending HTML FORM variables to the PHP file

Regarding my Illu, and because I am not english speaker native and because it good for me and even for english native i keep asking with illu... a picture worth 1000 words.

my best wishes,
Nothing2Lose
 
Posts: 28
Joined: Fri Apr 08, 2005 7:26 am

Postby dafunkymunky on Wed May 04, 2005 8:32 am

hi nothing2lose

i dont know mush about php but i surely know that
you can validate a form using javascript and then post using php

this link may help you

>>http://www.jonathanpress.com/programs/
if this link doesnt work go to www.jonathanpress.com and click on programming examples and in than
>>Send, Receive, & Manage Blind E-mail Accounts
Web PHP Freeware application


this guys email reply form validates using javascript but not sure if it is asp oh php

--DAFUNKYMUNKY
--------DAFUNKYMUNKY--------
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
User avatar
dafunkymunky
100+ Club
 
Posts: 183
Joined: Fri Apr 08, 2005 7:32 am
Location: India

Postby dafunkymunky on Wed May 04, 2005 8:33 am

forgot to tell one thing there is a link to download the script

--DAFUNKYMUNKY
--------DAFUNKYMUNKY--------
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
User avatar
dafunkymunky
100+ Club
 
Posts: 183
Joined: Fri Apr 08, 2005 7:32 am
Location: India

Postby Nothing2Lose on Wed May 04, 2005 10:58 am

hi,

the JavaScript solution that I wanted is here:

Code: Select all
<script type="text/javascript" language="JavaScript">

function ActionDeterminator()
{
if(document.myform.reason[0].checked == true) {
   document.myform.action = '/cgi-bin/mf1.cgi';
   }
if(document.myform.reason[1].checked == true) {
   document.myform.action = '/cgi-bin/mf2.cgi';
   document.myform.method = 'get';
   }
if(document.myform.reason[2].checked == true) {
   document.myform.action = 'http://yahoo.com';
   }
return true;
}
// -->
</script>

<form name="myform" method="post" action="/cgi-bin/mf.cgi">
Name: <input type="text" name="a name" size="22"><br>
Email: <input type="text" name="email"size="22"><br>
Reason:<br>
<input type="radio" name="reason">I have a Hot Tip!<br>
<input type="radio" name="reason">I saw a Cool Site!<br>
<input type="radio" name="reason">Get me outta here!<br>
Type comment here:<br>
<textarea name="comments" cols="27" rows="6">
</textarea><br><br>
<input
   type="submit"
   value="Send It!"
   onClick="return ActionDeterminator();">
</form>
Nothing2Lose
 
Posts: 28
Joined: Fri Apr 08, 2005 7:26 am


Who is online

Users browsing this forum: No registered users and 10 guests