next page after submit button is pushed?

Discussion in 'HTML & Website Design' started by joergermeister, Jan 2, 2009.

  1. #1
    Is it possible to make the following not open in new window? I added
    the onClick=. Ultimately I would like the users input to be saved and
    advanced to next page upon clicking of button.

    <td align="center" colspan="2">
    <input name="submit" type="submit" value="Save Page" onClick="window.open('onlinecv.php?section=Settings')"/></td>
    </tr>
    </form>
    </table>
     
    joergermeister, Jan 2, 2009 IP
  2. fairuz.ismail

    fairuz.ismail Peon

    Messages:
    232
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    example

    pageA.php

    <form action="pageB.php" method="post">
    <input type="text" name="field1"/>
    <input type="submit"/>
    </form>

    pageB.php

    <form action="pageC.php" method="post">
    <input type="text" name="field2"/>
    <input type="hidden" name="field1" value="<?= $_POST['field1'] ?>"/>
    <input type="submit"/>
    </form>

    with this example, what you submit in page A will be sent to page B, and automatically been put in the form in form B. So when you submit form B, there will be data from form A too.
    good luck!
     
    fairuz.ismail, Jan 2, 2009 IP
  3. joergermeister

    joergermeister Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    each page has a submit button. I just want to make it go to next page and save the input of each page after submitting. What i have written now does what i want but it opens a new window.

    <td align="center" colspan="2">
    <input name="submit" type="submit" value="Save Page" onClick="window.open('onlinecv.php?section=Settings')"/></td>
    </tr>
    </form>
    </table>

    all i added so far was

    onClick="window.open('onlinecv.php?section=Settings')"
     
    joergermeister, Jan 2, 2009 IP
  4. ideamonk

    ideamonk Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Change the type="submit" to type="button" in the input tag, that will stop making the current page goto onlinecv.php?section=Settings link and would let everything happen in a new pop-up window.
     
    ideamonk, Jan 2, 2009 IP
  5. joergermeister

    joergermeister Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    as soon as i change the onclick line from what you see below, it gives me error. what you see now works but opens in new window and i don't want it in new window.

    <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr>
    <td align="left" class="tcat">Online Application</td>
    </tr>
    <tr>
    <td align="left" valign="top" class="tborder">
    <?
    $q6 = "select * from content where lang = \"$lang\" and section = \"Jobseekers\" and title = \"Online CV\"";
    $r6 = mysql_query($q6) or die(mysql_error(Error5));
    $a6 = mysql_fetch_array($r6);

    echo "$a6[content]";
    ?>

    <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <form method=post>
    <tr>
    <td valign="top" colspan="2">
    <hr style='background-color: rgb(204, 204, 204);' width='100%' size='1' noshade='noshade' color='#cccccc'>
    </td>
    </tr>
    <?
    if($message == "application saved")
    {
    echo "
    <tr>
    <td colspan='2' align='left'><font color='red'><b>$section updated. If you wish to update any other section of your Profile/Application, please click on the link to the relevant section. <a href='search.php'>Click here</a> to begin searching for a job.</b></font>
    </td>
    </tr>";
    }
    ?>


    <?
    if($section == "Career Objective")
    {
    ?>
    <tr>
    <td colspan="2" align="left">Enter a headline that will reflect your career. e.g. Results Oriented QA Specialist, Great Organiser</td>
    </tr>
    <tr>
    <td align="left" valign="top" width="30%">Headline:</td>
    <td align="left">
    <input type="text" name="headline" value="<?=$a7[headline]?>">
    </td>
    </tr>
    <tr>
    <td colspan="2" align="left">Please specify the goals you want to achieve in your life. Include your skills, area of interests and specialisations.</td>
    </tr>
    <tr>
    <td align="left" valign="top">Career Objective:</td>
    <td align="left"><textarea cols="45" rows="8" name="objective"><?=$a7[objective]?></textarea></td>
    </tr>
    <tr>
    <td colspan="2" valign="top">Please enter the earliest date you are available to work. (mm/dd/yyyy)</td>
    </tr>
    <tr>
    <td align="left" valign="top">Date:</td>
    <td align="left" valign="top"><input name="available" type="text" value="<?=$a7[available]?>"></td>
    </tr>
    <tr>
    <td align="left" valign="top">Are you willing to relocate:</td>
    <td align="left" valign="top">
    <?
    if($a7[relocate] == 'Yes')
    {
    echo "
    <input type=radio name=relocate value='Yes' checked>Yes
    <input type=radio name=relocate value='No'>No
    ";
    }
    else
    {
    echo "
    <input type=radio name=relocate value='Yes'>Yes
    <input type=radio name=relocate value='No' checked>No
    ";
    }
    ?>
    </td>
    </tr>
    <tr>
    <td align="center" colspan="2"><input name="submit3" type="submit" value="Save Page" onclick="window.open('onlinecv.php?section=Settings')"/></td>
    </tr>
    </form>
    </table>


    thank you for your help everyone, JP
     
    joergermeister, Jan 3, 2009 IP
  6. Jaguarjace

    Jaguarjace Guest

    Messages:
    52
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    maybe onClick="window.location('onlinecv.php?section=Settings')" might work?.
    window.location doesn't open another window ;)
     
    Jaguarjace, Jan 4, 2009 IP
  7. joergermeister

    joergermeister Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    no, didnt work. It seems nothing works
     
    joergermeister, Jan 4, 2009 IP
  8. joergermeister

    joergermeister Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Does anybody have more suggestions. I am pulling my hair out with this. I just want it to go to next page after submitting. Post #5 is the code i am trying to change
     
    joergermeister, Jan 7, 2009 IP
  9. mediashare

    mediashare Active Member

    Messages:
    200
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #9
    Have you try my answer on Programming thread ??

    WoW Double thread :)
     
    mediashare, Jan 7, 2009 IP