currently the following code results in a "The page at http://localhost says:" and then displays my message with a yes and no button.
Code:
<script language="JavaScript">
function confirm_delete(){
input_box=confirm("Are you sure you want to permanently remove this?");
if (input_box==true)
[Code]...
how can i customise where the message says it is coming from?
I've been using a javascript confirm() box on submission of certain forms (i.e. when deleting a record) but I cannot get any popups to work in IE7. Even the simplest:
I've seen several sites that use what looks like the alert function (I know it isn't), where the site gets darkened and a popup box (similar to that of the alert one) comes up and displays an image (and only an image)
I want to display a Popup alert if select all checkbox is selected and number of rows in the grid are more than the number of check boxes selected. This code does that but it does on the second click on the select all check box, not on the first click.correction:
Code: <script type="text/javascript"> var TotalChkBx;
I am working on a PHP web application for my company and have run into a problem with Javascript. In a list I am displaying from a Mysql database, I have the option to delete certain entries. Before someone deletes an entry though, I want them to have an alert box pop up and asked then if they are sure. I have this simple javascript function in the head of the page, but whether cancel or ok are pressed, the page refreshes to the link. How can I fix it so that if you press cancel, nothing happens, other then the alert box goes away, but also allows the link to process if OK is pressed?
HTML Code: <script type="text/javascript"> function show_confirm(){ var r=confirm("Press a button!"); if (r==true){ alert("You pressed OK!"); }else{ alert("You pressed Cancel!"); }} </script>
I am using an alert dialog function I found online. The support for it has closed.Here is the page showing my alert button:Click here to view my test pageYou can check out the source html and the linked jquery files.The alert button works correctly by displaying an alert box.How do I apply this same behavior to a link?I want a user to click on the link, and:(1) receive the message they are leaving the site, then(2) be redirected to the other URL.
I want to pop up alert when the user browse file into input for example I have this input: HTML Code: <input type="file" name="myfiles[]" /> Now, when the user finish to browse an file I want a function to start working, what I mean by finish browse file is when the user select file and than click on the file he selected twice and than when the browsing files windows close I want this function to start.
On some sites I have worked on, users can delete content from their site. When they go to delete an item, I take them to a page where I pull the item details of the item they are about to delete from the dbase, and say "Are you sure you want to delete so and so". They can choose Yes / No. Yes takes them to action that runs the SQL to delete the item from the dbase. No takes them to the previous page.
I have seen some sites that have managed this process differently, where, instead of being taken to another page, a little pop up box opens saying "Are you sure", with a Yes / No option on it. Yes takes you to delete the item, No leaves them on the page they are on.
Am I right that this method uses Javascript? I know that it won't work if javascript is turned off, but - most people don't turn it off...
We've just been introduced to Javascript. I have a document where as it loads it gives an alert box. Upon clicking "OK" it brings up a header and an image and then another alert box stating that the page is now loaded. However, I need to change the background of the document by clicking on the "OK" button in the second alert box but can't figure out how to do that.
<style type="text/css"> .header2 { text-align:center; } p.center { text-align:center; } .center img { border-style: none; } </style> <script type="text/Javascript"> function rollover_onmouseover() { document.images.real.src = "../../Images/Homework 13/dream.jpg"; } function rollover_onmouseout() { document.images.real.src = "../../Images/Homework 13/real.jpg"; } </script></head><body> <script type="text/Javascript"> alert("I'm about to load my page"); </script> <script type="text/Javascript"> document.write('<h2 class="header2">This h2 header was loaded using Javascript</h2>'); </script> <p class="center">Point at Llumi to see what she's thinking<br /> <a href="Homework13.html" id="rollover" onmouseover="rollover_onmouseover()" onmouseout="rollover_onmouseout()"> <img src="../../Images/Homework 13/real.jpg" alt="" name="real" /></a> </p><script type="text/Javascript"> alert("My page is now loaded"); </script></body></html>
I would like to create a page that will refresh itself every 30 seconds or so, but I was hoping to be able to show an alert if the page has changed since last refresh. Is this possible?
I'm writing a calculator script that will need user input (how much they pay on internet, phone or cable bill) and then multiply those numbers by a known rate and then show the customer the new number.
I have the math setup (working right now), and the script works to spit out the answers in an alert.
Instead of the alert (which is the only thing I can do correctly at this point), I need the script to give the answers for each bill and then a total answer at the bottom.
The script is here, it's all in the index file. [URL]
Code: <script language="JavaScript"> var checkobj function agreesubmit(el){[code]....
i need to make it like if the button is clicked and there the agreement checkbox is not checked.. it should give an alert that the alert is not checked.. i know that would require a if and else statement but i cant figure out how to do it
Okay so I have the code as below. When the page loads both alerts trigger as they should and all the code works. If I take out the first alert, the second one still triggers (so I know the code is reaching the bottom) but for some reason my .change() function stops working. Placing an alert just inside does not trigger so it must be something before the .change(). Firefox's error console shows no errors though.
You see I'm trying to change an event like I'd change a property. The first will change the text to hello. I'd like the second to change the onmouseover event to display a hello world alert... but it doesn't seem to do anything.
I use Google Chrome because of the Javascript debugger that comes included and I keep getting the following errors with my AJAX script
Code:
Uncaught TypeError: Cannot call method 'getElementsByTagName' of null option.html:23 Uncaught TypeError: Cannot call method 'getElementsByTagName' of null option.html:40
[Code]....
What is supposed to happen is I press either button then it calls either getoptions1() or getoptions2() which then lists the options using listoption() Then the user selects a color and setoption() gets called. I'm having a problem with either getoption function or the listoption function.