lxndr Posted December 21, 2008 Share Posted December 21, 2008 I'm not sure if this is the best place to ask this question as it all depends on what the answer is. Basically, I need to modify an existing php program with reads in a file of messages and if there's a message for the user who's running the program it generates a javascript alert with the message displayed in it. What I need to be able to do is provide the means of replying to the alert. I could do away with the alert altogether of course but I need something that sits on top of the screen in all browsers that can only be got rid off by clicking OK (or by replying). I'm simply not sure of the best way to go about this and would welcome any positive suggestions or help. TIA.. Quote Link to comment Share on other sites More sharing options...
hellonoko Posted December 21, 2008 Share Posted December 21, 2008 What about a javascript popup window instead of a alert. You could use focus() to bring it to the front so they see it? Then you can have whatever page inside the popup with options for the user to click. Quote Link to comment Share on other sites More sharing options...
lxndr Posted December 21, 2008 Author Share Posted December 21, 2008 What about a javascript popup window instead of a alert. You could use focus() to bring it to the front so they see it? Then you can have whatever page inside the popup with options for the user to click. Do you know if that will that work cross-browser consistently including Opera and Safari ? __ Quote Link to comment Share on other sites More sharing options...
Andy-H Posted December 21, 2008 Share Posted December 21, 2008 No, javascript can be disabled by the user and therefor isn't consistant in any browser. Use something like PHP and make a little class or function to display it at the top of the page each time it loads, then when they do whatever update the status. Quote Link to comment Share on other sites More sharing options...
redarrow Posted December 21, 2008 Share Posted December 21, 2008 php example quick one. <?php // display message if field is empty if (empty($username)) { $error="Please enter a username.<br><br> <a href='whatever.com/start_agin.php'>Try agin</s>"; echo $error; exit; } if (empty($password)) { $error= "Please enter a password.<br><br> <a href='whatever.com/start_agin.php'>Try agin</s>"; echo $error; exit; } if (empty($email)) { $error= "Please enter a valid email<br><br> <a href='whatever.com/start_agin.php'>Try agin</s>"; echo $error; exit; } ?> 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.