2 forms out of 1 form

Discussion in 'PHP' started by jonhyhar, Jan 10, 2010.

  1. #1
    Hey guys, how can i put these 2 forms under a heading for 1 form ? :(

          <form action='manage.php' method='POST'>
          <input type='submit' class='button' value='Accep'>&nbsp;
          <input type='hidden' name='task' value='accept'>
          <input type='hidden' name='gid' value='12'>
          </form>
    &nbsp;&nbsp;
          <form action='manage.php' method='POST'>
          <input type='submit' class='button' value='Reject'>&nbsp;
          <input type='hidden' name='task' value='reject'>
          <input type='hidden' name='gid' value='12'>
          </form>
    
    Code (markup):
     
    jonhyhar, Jan 10, 2010 IP
  2. ajith107

    ajith107 Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hi,
    Try this
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Info</title>
    <script type="text/javascript">
    function set(val)
    {
    //alert(val);
    if(val==0)
    document.getElementById('task').value="reject";
    else if(val==1)
    document.getElementById('task').value="accept";

    }
    </script>
    </head>
    <body>
    <form action="count.php" name="myfrm" method="post">
    <label>
    <input type="radio" name="choice" value="accept" id="1" onclick="set(this.id)" />
    accept</label>
    <label>
    <input type="radio" name="choice" value="reject" id="0" onclick="set(this.id)" />
    reject</label>
    <input name="" type="submit" value="submit" />
    <input type="hidden" name="task" id="task">
    <input type="hidden" name="gid" value="12">
    </form>
    </body>
    </html>
     
    ajith107, Jan 10, 2010 IP
  3. jonhyhar

    jonhyhar Active Member

    Messages:
    166
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    but it's a radio button =/ I want only submit buttons :(
     
    jonhyhar, Jan 11, 2010 IP
  4. ajith107

    ajith107 Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    ok,
    just replace radiogroup with this
    <input type="submit" value="accept" onclick="set(1)" />
    <input type="submit" value="reject" onclick="set(0)"/>
     
    ajith107, Jan 11, 2010 IP
  5. abhijit

    abhijit Notable Member

    Messages:
    4,094
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    215
    #5
    Here it is you can try it..........



    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Info</title>
    <script type="text/javascript">
    function set(val)
    {
    //alert(val);
    if(val==0)
    document.getElementById('task').value="reject";
    else if(val==1)
    document.getElementById('task').value="accept";

    }
    </script>
    </head>
    <body>
    <form action="count.php" name="myfrm" method="post">
    <label>
    <input type="submit" name="choice" value="accept" id="1" onclick="set(this.id)" />
    accept</label>
    <label>
    <input type="submit" name="choice" value="reject" id="0" onclick="set(this.id)" />
    reject</label>
    <input name="" type="submit" value="submit" />
    <input type="hidden" name="task" id="task">
    <input type="hidden" name="gid" value="12">
    </form>
    </body>
    </html>
     
    abhijit, Jan 11, 2010 IP