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] Link to comment https://forums.phpfreaks.com/topic/16776-any-idea-why-this-wont-work/ 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... Link to comment https://forums.phpfreaks.com/topic/16776-any-idea-why-this-wont-work/#findComment-70667 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. Link to comment https://forums.phpfreaks.com/topic/16776-any-idea-why-this-wont-work/#findComment-70673 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! Link to comment https://forums.phpfreaks.com/topic/16776-any-idea-why-this-wont-work/#findComment-70677 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] Link to comment https://forums.phpfreaks.com/topic/16776-any-idea-why-this-wont-work/#findComment-70678 Share on other sites More sharing options...
killerb Posted August 7, 2006 Share Posted August 7, 2006 Well they both worked for me. Link to comment https://forums.phpfreaks.com/topic/16776-any-idea-why-this-wont-work/#findComment-70682 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.