Form Submit Button

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nick

    #1

    Form Submit Button

    Should be a quickie but I just can't get it to work.

    I have a form where my users can submit their football picks, when they
    click submit I would like another sized window to appear (mnf_scores.htm )
    where they can submit a total score for the Monday night football game each
    week. From the research I've done I think I need the following:

    // If this is change picks, output the submit button and close the form
    if ($userfunc==1) {
    echo "<p><input type=\"submit\" value=\"Submit Your Picks!\"
    onclick=\"windo w.open('mnf_sco res.htm','MNF Scores')\"/></p>\n</form>\n";
    }

    But that just doesn't seem to work. The submit part works but the subsequent
    window is not opened.

    Any idea what I'm missing?

    Sorry if I'm being dumb.

    Thanks in advance,

    Nick


  • Randell D.

    #2
    Re: Form Submit Button


    "Nick" <msunickb.nospa m@hotmail.com> wrote in message
    news:m5Cob.5530 0$275.139049@at tbi_s53...[color=blue]
    >
    > // If this is change picks, output the submit button and close the form
    > if ($userfunc==1) {
    > echo "<p><input type=\"submit\" value=\"Submit Your Picks!\"
    > onclick=\"windo w.open('mnf_sco res.htm','MNF Scores')\"/></p>\n</form>\n";
    > }
    >[/color]

    I'm not the best when it comes to javascript or client side behaviour,
    however I've been reading various hints on programming practice these past
    months in a magazine... one thing that might be causing you grief are the
    escape slashes you are using... Well... not many folk know that you can
    actually mix your inline PHP with HTML inside/around your code... look below
    for an example

    <?
    if($userfunc==1 ) {
    ?>

    <p><input type="submit" value="Submit Your Picks!"
    onClick="window .open('mnf_scor es.htm','MNF Scores')"></p></form>

    <?
    }
    ?>

    I believe the above is legal.... you can "enter/exit/re-enter" PHP parseing
    mode meaning you don't have to forcibly escape your html.

    Secondly... I'm just wondering... You have a space in the nameing of your
    window.open (ie "MNF Scores") I do not think this is allowed - try putting
    an underscore, or removing the space in the window name and give that a
    blast.

    Hope that helps...

    laters
    randelld


    Comment

    • Jon Kraft

      #3
      Re: Form Submit Button

      Nick <msunickb.nospa m@hotmail.com> wrote:
      [color=blue]
      > if ($userfunc==1) {
      > echo "<p><input type=\"submit\" value=\"Submit Your Picks!\"
      > onclick=\"windo w.open('mnf_sco res.htm','MNF Scores')\"/></p>\n</form>\n";
      > }
      >
      > But that just doesn't seem to work. The submit part works but the
      > subsequent window is not opened.[/color]

      Hi Nick,

      onClick() on a submit button is ignored. Try onSubmit().

      HTH;
      JOn

      --
      Your worship is your furnaces
      which, like old idols, lost obscenes,
      have molten bowels; your vision is
      machines for making more machines.
      -- Gordon Bottomley, 1874

      Comment

      • Nick

        #4
        Re: Form Submit Button

        Hey guys, thanks for the suggestions. I will give them a shot tonight when I
        get home and see what happens.

        I appreciate the help.

        Nick
        [color=blue]
        >"Jon Kraft" <jon@jonux.co.u k> wrote in message[/color]
        news:bo5bs4$185 0ru$3@ID-175424.news.uni-berlin.de...[color=blue]
        > Nick <msunickb.nospa m@hotmail.com> wrote:
        >[color=green]
        > > if ($userfunc==1) {
        > > echo "<p><input type=\"submit\" value=\"Submit Your Picks!\"
        > > onclick=\"windo w.open('mnf_sco res.htm','MNF[/color][/color]
        Scores')\"/></p>\n</form>\n";[color=blue][color=green]
        > > }
        > >
        > > But that just doesn't seem to work. The submit part works but the
        > > subsequent window is not opened.[/color]
        >
        > Hi Nick,
        >
        > onClick() on a submit button is ignored. Try onSubmit().
        >
        > HTH;
        > JOn
        >
        > --
        > Your worship is your furnaces
        > which, like old idols, lost obscenes,
        > have molten bowels; your vision is
        > machines for making more machines.
        > -- Gordon Bottomley, 1874
        >[/color]


        Comment

        Working...