Need help with buttons

  • Hiei
  • Beginner
  • Beginner
  • Hiei
  • Posts: 51

Post 3+ Months Ago

i have this form made which when the user clicks on one button and clicks submit they go to the page that button described, i have 3 buttons and one submit with javascript, except i don't know how to link them together, can someone help me? the code is below

Code: [ Select ]

<form>
<varname> = "<input type="radio">"
</form>

<form>
<varname1> = "<input type="radio">"
</form>

<form>
<varname2> = "<input type="radio">"
</form>

<form>
<input type="button"
value="submit">
</form>

<script type="text/javascript">

if(onclick == name,submit)
{
<javascript :window.location='http://somesite.com'">
}
if(onclick == name1,submit)
{
<javascript :window.location='http://somesite.com'">
}
if(onclick == name3,submit)
{
<javascript :window.location='http://somesite.com'">
}
  1. <form>
  2. <varname> = "<input type="radio">"
  3. </form>
  4. <form>
  5. <varname1> = "<input type="radio">"
  6. </form>
  7. <form>
  8. <varname2> = "<input type="radio">"
  9. </form>
  10. <form>
  11. <input type="button"
  12. value="submit">
  13. </form>
  14. <script type="text/javascript">
  15. if(onclick == name,submit)
  16. {
  17. <javascript :window.location='http://somesite.com'">
  18. }
  19. if(onclick == name1,submit)
  20. {
  21. <javascript :window.location='http://somesite.com'">
  22. }
  23. if(onclick == name3,submit)
  24. {
  25. <javascript :window.location='http://somesite.com'">
  26. }


p.s sorry the code is so long
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • OriginNO
  • Graduate
  • Graduate
  • User avatar
  • Posts: 137
  • Loc: the Glass City (Hometown: the NO)

Post 3+ Months Ago

Why have three buttons and a submit. Wouldn't it be less complicated to just have 3 buttons that submit and go to the pages you want them to? For example:

Submit Button 1
Submit Button 2
Submit Button 3

Code: [ Select ]
<form action="http://www.somesite.com">
 <input type="submit" value="button1" name="Submit">
</form>
<form action="http://www.somesite.com">
 <input type="submit" value="button2" name="Submit">
</form>
<form action="http://www.somesite.com">
 <input type="submit" value="button3" name="Submit">
</form>
  1. <form action="http://www.somesite.com">
  2.  <input type="submit" value="button1" name="Submit">
  3. </form>
  4. <form action="http://www.somesite.com">
  5.  <input type="submit" value="button2" name="Submit">
  6. </form>
  7. <form action="http://www.somesite.com">
  8.  <input type="submit" value="button3" name="Submit">
  9. </form>


One less form you have to wright and no javascript. ;)
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

if you must have radio buttons for this

Code: [ Select ]
<form>
<input type="radio" name="page"onClick="go("pagename");" >
<input type="radio" name="page"onClick="go("pagename");" >
<input type="radio" name="page"onClick="go("pagename");" >
</form>
  1. <form>
  2. <input type="radio" name="page"onClick="go("pagename");" >
  3. <input type="radio" name="page"onClick="go("pagename");" >
  4. <input type="radio" name="page"onClick="go("pagename");" >
  5. </form>


HAVE A GOODEN!

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 41 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.