Jump to content

got another prob!!HTML...

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
7 replies to this topic

#1
joie2

joie2

    Newbie

  • Members
  • PipPip
  • 17 posts
<html>
<body>
<form action="form1.htm"method="get">
<input type="radio"name="one">Choice One
<input type="radio"name="one">Choice two
<input type="submit"value="Check">
</form>
</body>
</html>


got that code and im thinking what is if i'll choose choice one and press the check button the output would be 123 while if ill choose choice two the output would be abc....
how could i do that???

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
You really need to set the value properties for your radio buttons: HTML Forms and Input
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
I always learned by example.
<?PHP
//form1.php
print_r($_GET); //echo $_GET['one']; // this is abc or 123 depending on the button
?>
<html>
<body>
<form action="form1.php" method="get">
<input type="radio" name="one" value="123">Choice One
<input type="radio" name="one" value="abc">Choice two
<input type="submit" value="Check">
</form>
</body>
</html>


#4
joie2

joie2

    Newbie

  • Members
  • PipPip
  • 17 posts
i already knew those things...the thing im asking was that when you have that two radio button,a submit button, when you click on the first radio button and click the submit button it will bring you to a page that has a content of 123 while when you choose the second radio button and click submit it will bring you to a page containing abc...could it be posible with just purely html???

#5
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
No, not purely HTML.

Javascript can help you, I know it can access get, I am pretty sure it can get post as well, not totally sure about post though.

PHP can help you, and if you use .htaccess you can make it look like a .html page.

#6
joie2

joie2

    Newbie

  • Members
  • PipPip
  • 17 posts
ops maybe can't do that coz i suppose to do only a html file..but thank you...

#7
zeroradius

zeroradius

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,406 posts
You can't do this purely HTML. HTML is a markup language not a programming language so you can't do logic with it.
Posted Image

#8
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
You can do that with Javascript.. and you will only use an HTML file :)