Can A Hyperlink Call A Javascript Confirm Prompt?

Mar 17, 2006

Hi, I have this JavaScript, which I only want to occur if a user clicks on a
hyperlink hotspot in a large image:

<script type="text/javascript">
<!--
var answer = confirm ("This link is not available, click OK to load a
similar link, or Cancel to not.")
if (!answer)
window.location="http://www.yahoo.com/"
// -->
</script>

To make matters more challenging, there are about 10 hotspots in the image,
and I want them each to have a different value for window.location. I.e. if
the user clicks OK in each hotspot, each one will redirect them to a
different site.

View 17 Replies


ADVERTISEMENT

Call Prompt Within A Function On OnClick Event?

Aug 31, 2011

I have a button that I wish to call a predefined function (Go()) shown below, but, I wish part of the URL that is sent to the function be inputted by the user.

function Go(URL)
{
window.location = URL;
}

Here is the code I have for the button, but I am getting a syntax error. What do I need to do?

<input type="button" value="Duplicate" onclick="Go(CustomerMailingList-duplicate.asp?ID=<%=rs(strPrimaryKeyFieldRecordset)%>&CustNum=prompt('Enter New Cust #', '0')">

View 5 Replies View Related

JQuery :: Call A Coldfusion Function Using On Clicking A Hyperlink?

Aug 27, 2010

I have a cfm file that has a url that directs the page to another cfm pageI would like on clicking the url to call a coldfusion function befor going to the next pageexampleI have a component mycomponent

<cfcomponent>
<cffunction name="increaseviews">.
<cfargument arg1..>

[code]....

View 1 Replies View Related

Javascript And Confirm

Oct 13, 2006

This is a weird one and I am wondering if someone can help?

I have a piece of Javascript
function deleteRequest(searchID) {
if (confirm('Are you sure?')){
location = "index.php?spDB=inactive&searchID="+searchID;
}
}

When the page gets reloaded, it runs a database query and something is
made inactive.

The problem is:

When the confirm box appears, if I press OK quickly, the database query
doesn't happen. If I wait 1 second and then press OK, it is fine and
the query is run.

Basically it appears that the time between the confirm javascript
appearing and the time taken to press the Ok button affects the
reloading of the page.

Has anyone else had an issue like this?

View 1 Replies View Related

Javascript Confirm Box

Sep 21, 2006

I have created a form with two submit button “Delete and Edit” in the form I have a javascript code, that displays a confirm box when the delete button is clicked, clicking on cancel should stop the execution of the delete script and ‘ok’ should run the script. Now, using the form this way works perfectly in Mozilla fireworks, but IE posing a problem when I click on cancel, it still executes the delete script.

<form method="post" action="eddel.php" >
<input type="submit" value="delete" name="delete" onclick=”return confirm(‘are you sure you want to delete record?’)”;>
<label>
<input name="edit" type="submit" value="edit" />

</form>

View 1 Replies View Related

Javascript Confirm Popup.

Jul 21, 2005

I have never done any javascript at all but I think it can do what I want with ease.

Basically at the moment I have a link that calls a delete script written in php. The delete script just deletes and item from my mysql database. What I would like is a popup to appear when the link is clicked that asks for the user to confirm they wish to delete.

Could anyone either show and example or point me to a site that may have a tutorial or something.

View 6 Replies View Related

JavaScript Confirm -> Goto

Jan 16, 2006

I currently have the follwoing javascript function: Code:

/**
* ask question, if true goto X
*/
function watsConfirmAction( question, letsgoto )
{
// ask question
if ( confirm( question ) )
{
// on YES goto location
location.href = letsgoto;
}
}
which is used as follows:

HTML Code:

<a onClick="watsConfirmAction('ask question', 'some URL')">link</a>

If a user doesn't have javascript, for whatever reason, this will fail to send them anywhere. is there a better way of doing this to allow for javascript non compliant browsers?

View 3 Replies View Related

Need To Cancel A Javascript Alert/confirm Box

Jul 23, 2005

A description of the problem:
1) Go to a page with various settings and a timeout (forces re-login
if over 10 minutes)
2) Before the timeout, make some changes to settings.
3) Press a "reset to defaults" button that uses a confirmation box to
let the user know what is about to be reset (lists items).
4) Walk away while the confirm box is displayed and come back after
the page timeout.
5) My screen now has the page, a confirm popup on top of that, and a
timeout alert on top of that.
6) Press OK to dismiss the timeout alert. The underlying page goes to
the login screen, but the confirm box remains.

How can I clear any javascript alert/confirm popups in this situation
automatically?

View 7 Replies View Related

Hyperlink And Mailto Within JavaScript Alert Box?

Jan 31, 2006

I'm sure there's a way to accomplish this...without continually beating my head against my keyboard. Hopefully someone can point me in the right direction.

How do I add a hyperlink within a JavaScript alert box? And how would I add a mailto link within a JavaScript alert box? I've read the post a few below mine with the response being to use a DIV instead. How would I do that?

View 4 Replies View Related

Javascript Alert/Confirm Dialogs And I18N

Apr 3, 2006

I'm pretty sure after reading this board and many like it that it is
impossible to change the ok, ok/cancel buttons that appear by default
in the alert and confirm javascript dialogs. Now for question one why
not? And question two why do they still say ok and ok/cancel when
viewed in a non-english browser install?

I have installed Chinese IE 6.0 and these buttons still say Ok/Cancel.
the rest of the browser (buttons, menus, etc...) is in Chinese except
for these two stupid buttons. No one final question, whould having a
reginonal OS installed make any difference. Right now I'm using an
English OS but with the Chinese browser mentioned above.

View 1 Replies View Related

How To Call A PHP Script Using JAvaScript

Mar 18, 2006

First let me describe the problem. I have an HTML form that in one
field has an onBlur call to a JavaScript function. When you exit the
field, it calls the JavaScript routine, which in turn calls a PHP
script. The PHP script runs returns the value needed. And returns to
the JavaScript. The JavaScript function is then supposed to set
alerts depending on the values returned from the PHP script. It
doesn't. If you then move the cursor into the field and exit again,
it again runs the JavaScript which calls the PHP script then
proceeds to show the alerts exactly like it is supposed to.

I did some experimenting, and if you use a button to run the
JavaScript, the exact same thing happens. Click the button and the
PHP script sends back the value, but no alert. You click the button
a second time, and the alert shows.

I am using the JavaScript monitor in FireFox v1.5 so I can see that
the PHP script is being called and returning the correct value the
first time. So what I am trying to figure out is why the routine has
to be called twice before I get my alert.

Below is the HTML, JavaScript & PHP that I am using....

View 7 Replies View Related

How To Call The Text_changed Event From Javascript

Jul 23, 2005

I ve a aspx page with a textbox.I have created the Text_Changed event
for this textbox.We know that , this will be fired when we enter any
text in that textbox and pressing the enter key.quite natural.

I am putting some text in that text box thru javascript from the
window_onfocus event.

After that , i need that the text_changed(server event) event to be
fired,so that i could perform some search operation.

Could you please tell me how can i call the Text_changed server event
from the javascript.

View 1 Replies View Related

Call A Java Method From Javascript

Jun 5, 2006

I am trying to call a java method from within my Javascript, but cannot
seem to get it to work. All the examples I have found online and in
the forums are using Java applets. I have a method that I want to call
that does a search, and produces a message dialog displaying the
results. Also, the class file lives next to the html file. How would
I invoke this in my code? This is what I have now:

<script>
function searchStrings(){
Searcher.search();
}
</script>
<form>
<input type="button" value="Search" onclick=searchStrings()>
</form>

View 2 Replies View Related

How To Properly Call A Function In Javascript?

Apr 26, 2010

I have my events and syntax in the immediate script and they were working fine. But Im trying to move it all into the Script tags and call on them by using the function ID but cant seem to figure it out. here's what I got:

<html>
<body>
<script type="text/javascript">
function txtAmenity()

[code]...

View 2 Replies View Related

Testing Javascript Call To Applet?

Mar 22, 2005

Does anyone know how you can test if an applet's method exists before you try and call it?

for example, if you don't have a JRE installed on your computer and try and access an applet method it shoots out a javascript error at you. I want to be able to test if the applet is operational basically before I try and use any of its methods.

View 2 Replies View Related

Call Javascript Function From Pdf Link

Jun 24, 2007

I have a script that is working well to detect if the client has acrobat reader is installed or not. I can print out next to the PDF link if the user has or hasn't got the reader. My problem is that i want to call that function and print something out only if the user clicks on the link to see the PDF file. This is where i'm at at the mo

echo "<br>Price: Euro ";
echo $price."<br />";
echo "<a href = "pdf/$pdf">";
?>
<script type="text/javascript" src="plugins.js">
</script>
<?php
echo "See Pdf</a></td>
";

?>
</tr>

View 1 Replies View Related

How To Call Javascript When Movie Is Finished?

Jun 12, 2002

I have the following windows media player object integrated in a page. How to call a javascript action when the movie is finished?

View 2 Replies View Related

Call Python Script By Javascript In Html

Feb 28, 2006

do you know if it's possible to call a python script in html page?? I want call my script pyhton and I have a html with javascript but I don't know how, do you have an example??

View 2 Replies View Related

Call Javascript In Parent From Child (pop Up) Window

Jan 12, 2007

I have some javascript that works in Firefox 2 but not in IE 7. In the
parent page, a user clicks a link and a new window is opened so that
they can maintain some values. When the user is finished, they can
click either a save or a cancel button. If the user clicks the save
button, I want the parent page to be refreshed and then the child
window to close. I have this working perfectly in FF2 but it does not
in IE. In IE, the parent page is refreshed but when it refreshes, the
screen that comes back is the same screen as the child window. When
the child window should close, it instead is being refreshed and comes
back as a blank screen. Code:

View 1 Replies View Related

Call Javascript Files In Header Or Footer?

Sep 14, 2010

I've been using JavaScript for a few years now I'm not a huge expert I rely more of JQuery. I am just wondering what best solutions are there to call Javascript files (and to make pages load faster):

Normally I request all these in the Header like you normally would but I have seen and heard people to call their Javascript files in the footer to make page load faster and have all their Javascript functions all in the footer as well.

Is this a good idea? What are the downside? Should I just keep all my JS in the Header as usual?

View 1 Replies View Related

Javascript To Call CSS File Based On Browser

Jun 20, 2002

I have seen this employed somewhere else, but for the life of me cannot remember how it was done. I need to write a javascript that will call a desired CSS file based on the user's browser.

View 3 Replies View Related

Call Parent Javascript Function From Inside An Iframe?

Apr 5, 2006

The challenge is as above really. I have a page with an iframe in it, and need to call a JS function in the *parent* page, *from* inside the iframe.

(It's for Google Maps, but I won't bore you with the complexities of that, as it doesn't affect the question).....

View 18 Replies View Related

Confirm Box

Jul 23, 2005

is there a way of changing the values of the confirm box from ok / cancel to
yes / no

i have the following alert/confirm box but it is worded in a way that the ok
and cancel do not make sense:

function confirmNewSupplierWelcome(){
return confirm(
'Before going on to request a new supplier
'
+ 'are you sure there is no suitable alternative?'
+ '
Remember, new suppliers are authorised by exception only'
);
}

View 8 Replies View Related

Create (or Call) A "Windows-TM" Pop-up In Javascript?

Jul 20, 2005

In fact, I want to suppress the right-click menu and use mine : It must like
same look and feel than the original context menu ...

View 1 Replies View Related

Get Hyperlink Value ?

Aug 22, 2011

This is my code:

Here how can i get that number 34?

View 2 Replies View Related

Getting The Value Of Hyperlink

Aug 11, 2011

I need to pass the value of hyperlink to another jsp page.

For eg.,

Now, i need to retrieve the value, sample and pass it to another page.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved