glenelkins Posted August 7, 2006 Share Posted August 7, 2006 Hi any ideas why the confirm dialog wont show?[code]// Check if the user has finished creating their profile if ($finished == 0) { ?> <script language="javascript"> if (confirm ('Have You Finished Creating Your Wedding Page?')) { alert ("Ok"); } else { alert ("Bummer") </script> <? }[/code] Quote Link to comment Share on other sites More sharing options...
Chips Posted August 7, 2006 Share Posted August 7, 2006 no closing bracket on the else statement, no semi colon line termination after the second alert, and only short php tag used to return to php?Dunno if those are "bugs" per say, my javascript is shaky... Quote Link to comment Share on other sites More sharing options...
king arthur Posted August 7, 2006 Share Posted August 7, 2006 Javascript doesn't insist on semi-colons after each statement, but the lack of the closing bracket would certainly prevent that code from running. Quote Link to comment Share on other sites More sharing options...
killerb Posted August 7, 2006 Share Posted August 7, 2006 I have had errors from validator.w3c.org that 'language' is not a valid attribute for a script tag, though I think I have had js running in tags like that before. Use type="text/javascript" anyway, I don't know if that will fix it, it looks OK to me.We must be nearing the end of the world - computers are not obeying our command! Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted August 7, 2006 Share Posted August 7, 2006 [code]// Check if the user has finished creating their profile if ($finished == 0) { ?> <script type='text/javascript'> if (confirm ('Have You Finished Creating Your Wedding Page?')) { alert ("Ok"); } else { alert ("Bummer") } </script> <? }[/code] Quote Link to comment Share on other sites More sharing options...
killerb Posted August 7, 2006 Share Posted August 7, 2006 Well they both worked for me. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.