By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,738 Members | 1,870 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,738 IT Pros & Developers. It's quick & easy.

Form Submit Button

P: n/a
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=\"window.open('mnf_scores.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
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Nick" <ms*************@hotmail.com> wrote in message
news:m5Cob.55300$275.139049@attbi_s53...

// 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=\"window.open('mnf_scores.htm','MNF Scores')\"/></p>\n</form>\n";
}


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_scores.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
Jul 17 '05 #2

P: n/a
Nick <ms*************@hotmail.com> wrote:
if ($userfunc==1) {
echo "<p><input type=\"submit\" value=\"Submit Your Picks!\"
onclick=\"window.open('mnf_scores.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.


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

Jul 17 '05 #3

P: n/a
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
"Jon Kraft" <jo*@jonux.co.uk> wrote in message news:bo*************@ID-175424.news.uni-berlin.de... Nick <ms*************@hotmail.com> wrote:
if ($userfunc==1) {
echo "<p><input type=\"submit\" value=\"Submit Your Picks!\"
onclick=\"window.open('mnf_scores.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.


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

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.