Javascript Confirm Redirect

I am looking to figure out how to do a javascript confirm
Redirect popup. Can anyone help me out with that? Is there a
Dreamweaver behavior for that?

I'm not sure exactly what you mean, but it's easy enough to
make a popup (to
open a second sized browser window) by using DW's Open
Browser Window
behavior.
Patty Ayers | www.WebDevBiz.com
Free Articles on the Business of Web Development
Web Design Contract, Estimate Request Form, Estimate
Worksheet
"joey_a" <[email protected]> wrote in
message
news:edbo7j$iea$[email protected]..
>I am looking to figure out how to do a javascript confirm
Redirect popup.
>Can anyone help me out with that? Is there a Dreamweaver
behavior for that?

Similar Messages

  • Delete button control: Javascript confirm & redirect?

    Hello all,
    I have a contract details page that has the following buttons: Save, Cancel, Delete. The Cancel button has a general redirect assigned to it, since no processing is necessary. As for the Save button, the page submits to itself, so the screen just reloads quickly, with a note to show the record was updated. As for the delete button, I don't want the user to remain on a details page for a contract they just deleted, so I wish to redirect the user to my contract search page after the record is deleted. I also want to have the button confirm the deletion before proceeding.
    My current page setup is as follows:
    SAVE button (template based)
    Optional URL Redirect - No Target
    DELETE button (template based)
    Optional URL Redirect - Page 3 (contract search)
    "Request" and other fields here are empty
    CANCEL button (template based)
    Optional URL Redirect - Page 3 (contract search)
    "Request" and other fields here are empty
    BRANCHES Information:
    Before Validation:
    DELETE:
    Target type - page in application (3 - contract search)
    Request - DELETE
    When Button Pressed - BTN_DELETE
    After Processing:
    Target type - page in application (2 - contract details)
    When Button Pressed - BTN_SAVE
    Here's my dilemma...under the setup listed above, clicking Delete redirects me to the search page, but the record is not deleted (I do have a DML process set up for Insert/Update/Delete, set up for After Submit). I've tried changing both the button and/or branch properties to set up URL processing, entering javascript to confirm the deletion. No matter the combination I use, either the contract will not get deleted, or the deletion is a success, but I get an error message that there is no branch page set up for that. If anyone has suggestions as to how I can get validation to play nicely with deleting records, it would be much appreciated.
    Thanks,
    Brian

    Mike,
    Is it possible that you have more than 1 branch to the target page? yes I do, before I had the Unconditional branch on top. Now I moved the conditional branch to the top. Redirect is working fine but no luck with passing values. After some research I found that it passes the request value when I send it as a string but not as value of the item on page. This may have something to do with in-built Delete procedure.
    I am very new to Apex/Oracle and I don't know how to create a oracle workspace and post my App on line. So, I am giving a detailed description of what I am trying to achieve. please bear with this while I try to figure out how to post it on line.
    This is exactly what I am trying to do.
    On the first page I have multiple regions to show different reports based the user selection. User clicks a button to make a selection. I am toggling between the regions depending on the request value from the button click.
    If the user decides to modify a record he is directed to a form. After modifying I want the user to come back to the first page and be in the same region where he was initially.
    To achieve this
    --- I am passing the request value from the first page to the form and saving it in a hidden variable. In the unconditional branch I am passing that value back and it is working fine.
    --- Only for the Delete operation I have problems. I still want to have the Alert so I am using the javascript:confirmDelete(htmldb_delete_message,'DELETE'); in the Delete button URL.
    I created a conditional branch which has lower sequence than the unconditional one.
    I have set the condition as Request = Expression 1(DELETE) not the button click.
    In the Action part, i have the following
    Target type Page in this Application
    Page: 21
    Request: &P21_Old_Request.
    Clear Cache
    Set these items P21_Item1
    With these values &P22_Item1.
    I have seen that page redirect is working fine.( I tried to redirect to other pages it works fine). Only the values are not passed. I tried to pass these values as Application level items even then it doesn't do anything. But if u pass the string directly it would pass the string. But I want to be able to pass the value as an Item from the form.
    As I mentioned before it may be to do something with in-built Delete procedure.
    Is there way to see the SQL of that procedure?
    Do u have any suggestions for me?
    Thanks in Advance.
    Nimmi

  • How to Add A Javascript Confirm() on an Apex button for a form?

    Hi, how can I add a Javascript confirm() to a button in Apex for a form? Thanks.

    Hello:
    You could do the following
    1)In the 'Option URL Redirect' section of the Edit Button page set 'Target is a ' to 'URL'
    2)For URL Target enter javascript:{if (confirm('Your Question here')) doSubmit('<button name>');}Varad
    Edited by: varad acharya on Jul 15, 2009 3:47 PM

  • Problem with javascript confirm() in a JSP

    I'm trying to use a confirm() box in a jsp. I've looked at tons of examples and I still have the same problem. If I just add this to my page the prompt will pop up as expected: (of course it doesn't really do anything.)<SCRIPT LANGUAGE="JavaScript">
    confirm( "Are you sure you want to delete?" )
    </SCRIPT>As soon as I add an if clause around it it doesn't even pop up anymore, such as:if (confirm("Are you sure you want to delete?")){
    <%
         Do some jsp stuff
    %>
    else {
    <%
         Do some jsp stuff
    %>
    }I can include more of the code if needed. This code is for deleting some files, so I want to add an "are you sure prompt?". If they hit ok it will delete, otherwise cancel the operation.
    I assume that the "if confirm( "Are you sure you want to delete?" ) " should wait for a reponse before continuing. Any help is appreciated.
    Thanks,
    James

    You can use Javascript to confirm a delete, and delete an object in the following manner.
    //link to delete an object..
    <a href="thisPage.jsp?delete=<%= itemID %>"
       onClick="return confirm('Are you sure you wish to delete this item?');">delete</a>Then, at the top of the JSP pageif(request.getParameter("delete") != null)
       //do whatever to delete, then load the page as normal
    }Now, your item will be deleted, and the page will be refreshed to show the changes.

  • Javascript  Confirm Based on server time!!

    Hello Everybody,
    I want to raise a javascript confirm dialog box based on the server time. On button click, I want to raise the following code if the time is between 11 am to 24pm.
    E.g.
    IF l_time BETWEEN '11:00' AND '24:00' THEN
    htp.p('<script>');
    htp.p('var r=confir("Do you want to proceed?");
    htp.p('........so on');
    htp.p('</script>');
    ELSE
    -- just submit the page
    END IF;
    Any help will be appreciated!!
    Thanks,
    Parveen

    Hi,
    a.Always mention the Apex version, in every post.
    b. Always enclose your code in a pair of tags to make is more readable.
    Javascript can read the local machine time. If you want to access the server time you will need to use PL/SQL or SQL for that and pass that to the javascript function.
    Any specific reason why you are generating the JS through PL/SQL? Its so much easier to decalre the function in the Page HTML Header rather than doing htp.p.
    Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Javascript Confirm box dependent on results of query

    Hi
    I'm using Apex version 3.2.1 and I'm looking for a way to do the following, any help much appreciated:
    A javascript confirm box will appear when the user submits a page if the result of a query returns anything, the query would look something like this....
    SELECT * FROM LINKEDPROJECTS
    WHERE ENV_ID = :P18_ENV_ID
    AND COMP_ID = :P18_COMP_ID
    AND DATE_FROM <= to_date(:P18_DATE_TO, 'DD-MON-YY')
    AND DATE_TO >= to_date(:P18_DATE_FROM, 'DD-MON-YY')
    If it doesnt return any data the page will submit as normal, if it does return any data the confirm box will appear, and the message will also be driven by the result of a query.
    So the message would be something like....
    Project(s) +"Select NAME FROM PROJECTS WHERE ID IN (SELECT PROJ_ID FROM LINKEDPROJECTS WHERE ENV_ID = :P18_ENV_ID+
    +AND COMP_ID = :P18_COMP_ID+
    +AND DATE_FROM <= to_date(:P18_DATE_TO, 'DD-MON-YY')+
    +AND DATE_TO >= to_date(:P18_DATE_FROM, 'DD-MON-YY')"+ have this environment booked on the dates you selected.  Do you want to continue with the booking?
    Selecting yes submits the page, selecting no returns them to the page.

    In a nutshell (and some pseudo code):
    The button URL would look something like "javascript:beforeSubmit()" without quotes and where beforeSubmit is the name of your function.
    The function would look something like:
    function beforeSubmit() {
      var runQuery = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=RunTheQuery',1);
      var result = runQuery.get();
      if (result = 0) {
        if (!apex.confirm('Submit page?")
          return;
      doSubmit('SUBMIT');
    {code}
    The application process, called "RunTheQuery" in this example, is a PL/SQL block that runs the query and return the value using the htp.prn function.
    There are probably errors in the above as I just did this off the top of my head, and you will probably need to tweak it somewhat.  But hopefully you get the idea.
    Mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Javascript confirm alert Can we change the text ok

    can we change the ok and cancel text in the javascript confirm alert. pls respond, its very ungent
    Edited by: Bini John on Jun 10, 2009 9:19 AM

    Hi,
    Yes if client want new description for the PS Group, you have to create new only and assign the wage types to them and so on..... you have to do all the configurations regarding the PS Group. Here the main point is be careful with the start date of the PS Group for newly created records and assignments.
    Best Regards.

  • Call a process based on the click of a javascript confirm popup box

    I have created a function to create a javascript confirm popup box which calls an update process called Reactivate_save(), see below:
    function reactivate_save()
    var r=confirm("Do you wish to save pending changes?")
    if (r==true)
    document.getElementById('Reactivate_Save').call();
    I want to make the update process conditional on clicking the 'ok' button inside the popup box.....Is this possible?
    I thought that I could reference it by using:
    value in expression 1 = expression 2
    reactivate_save() = true or 1
    Neither of these worked and wondering if there is something else that I can use?
    Thanks,
    Chris

    Hi,
    Your function is in Javascript while the process is PL/SQL. What you need to do is somewthing like this
    if (r==true)
    document.getElementById('Reactivate_Save').call(); // not sure what this does so left it as it is
    doSubmit('MY_REQUEST');
    }You can now use the 'MY_REQUEST' request, or whatever else you choose to call it, in the process condition using
    1. Request = e condition type by entering MY_REQUEST in the Expression 1
    or
    2. PL/SQL Expression type with :REQUEST = 'MY_REQUEST' in expression 1
    Note : In Apex 3 and below you need to add a semi colon at the end of PL/SQL Expresssions
    Regards,
    PS : Noticed that this is the same as call a process based on the click of a javascript confirm popup box
    Edited by: Prabodh on Sep 28, 2010 9:05 PM

  • Firefox hangs sometimes on javascript "confirm"

    Sometimes, firefox hangs on "confirm" msgbox called from the javascript "confirm" function. The msgbox is displayed but both the OK and Cancel buttons are unresponsive and nothing else remains to do that terminate firefox
    == This happened ==
    Not sure how often
    == Appear the confirm messagebox

    Does this happen on specific websites, if so which ones?
    We'll need some more info about your Firefox setup. Go to '''Help > Troubleshooting Information''', then click '''Copy all to Clipboard'''. Open a reply to this post, and go to '''Edit > Paste''' to paste the info from your Troubleshooting Information page.

  • Value from backing bean in javascript confirm in 10.1.3

    Hallo,
    Please help
    I have 2 problems:
    Page with 1 record, where 8 items are updatable.
    In entity I 've a method where I set a value in bean. (BotId1 is one of these 8 updatebale items)
    What I expect: when I change a value in BotId1 the value of botId in ValiderenBotBean will be also changed
    public void setBotId1(Number value) {
    setAttributeInternal(BOTID1, value);
    EL.set("#{ValiderenBotBean.botId}",BotId.toString());
    My bean (session scope):
    package viewcontroller.pagedefs.produceren.backing;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    public class ValiderenBotBean
    private static Log log = LogFactory.getLog(ValiderenBotBean.class);
    private String botId;
    public ValiderenBotBean() {
    // accessors
    public void setBotId(String botId) {
    log.debug("setBotId : " + botId);
    this.botId = botId;
    public String getBotId() {
    log.debug("getBotId : " + this.botId);
    return this.botId;
    Op my generaten page I have the button:
    <af:commandButton actionListener="#{bindings.Commit.execute}"
    action="Commit" onclick="if (validateForm('dataForm')){return(confirm(#{ValiderenBotBean.botId} + 'la')}"
    rendered="#{(((jhsUserRoles['JDMR_PRD03']) or (jhsUserRoles['JDMR_PRD03'])) or (jhsUserRoles['JDMR_PRD03'])) or (jhsUserRoles['JDMR_PRD03'])}" textAndAccessKey="#{nls['SAVE_BUTTON_LABEL_KOPPELENPRODUCTIEGEGEVENS']}"
    id="KoppelenProductiegegevensSaveButton">
    <af:resetActionListener/>
    </af:commandButton>
    I get the following error:
    Foutdetails webpagina
    Gebruikersagent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; AskTB5.6)
    Tijdstempel: Thu, 17 Feb 2011 13:54:46 UTC
    Bericht: Syntaxisfout
    Regel: 3744
    Teken: 1
    Code: 0
    URI: http://172.16.6.108:8988/demeter/adf/jsLibs/Common10_1_3_2_0.js
    The code from Common:
    3732 function _callChained(
    3733 a0,
    3734 a1,
    3735 a2
    3736 )
    3737 {
    3738 if(a0&&(a0.length>0))
    3739 {
    3740 if(a2==(void 0))
    3741 {
    3742 a2=a1.window.event;
    3743 }
    3744 var a3=new Function("event",a0);
    3745 a1._tempFunc=a3;
    3746 var a4=a1._tempFunc(a2);
    3747 a1._tempFunc=(void 0);
    3748 return!(a4==false);
    3749 }
    3750 else
    3751 {
    3752 return true;
    3753 }
    3754 }
    Problem nr.1:
    When I call the button I do not see any logging that indicate that the value is set in backing bean
    Workaround: I made item on my page depending on item where I put my code.
    Result: I have to press 2 times on my button to execute the button code. First time to make the validation and the second time the button code itself.
    Not nice. The validation is also slow.
    But ok:
    Problem 2:
    I still get the same error, I see logging of execution of my validation.
    There is also the difference between loggings is 2 cases:
    If I use
    onclick="if (validateForm('dataForm')){return((#{ValiderenBotBean.botId} + 'la')}"
    what I really want instead of
    onclick="if (validateForm('dataForm')){return'la')}"
    I get:
    17-feb 14:28:40 DEBUG (ValiderenBotBean) -getBotId : -1
    17-feb 14:28:40 DEBUG (ValiderenBotBean) -getBotId : -1
    It means that value is obtained correctly.
    But still the same error.
    If I put for test purpose
    the following code into my bean:
    public String getBotId() {
    log.debug("getBotId : " + this.botId);
    botId = "23";
    return this.botId;
    I do not get any error.
    Any ideas?
    Please help

    Thanks, Amit,
    I will try it tomorrow.
    Some remarkes:
    1. I need javascript for confirmation
    2. I really do not PPR. It takes so long. The user use the scanner to put the value into input items in order speed up the process. And now PPR...
    3. My transient attribute will depend on 8 items. Even more waiting process.
    What I really want is to execute my db function only 1 time "onclick" or "oncommit" and according to outcome of db-function ask user for confirmation of commit.
    I tried already to implement dialog from ADF with launchDialog function.
    But ReturnListener did not function while I launch the Dialog manually.
    Anna

  • Wish to write Javascript to redirect somewhere if user is NOT logged in...

    I need to write a simple Javascript window.location routine to execute if a user comes to my main portal page but is not logged in.
    It sounds odd, but the reason for this is that we use IBM's WebSEAL product to provide proxy and authentication - Portal is configured to work with this, but if a user bookmarks the main portal page (after logging in through the WebSEAL URL junction), and then closes the browser, re-opens the browser and tries to go to that bookmark, even though WebSEAL will challenge and authenticate, Portal will not know the user. The reason it works when you go thru the WebSEAL junction name is that we manually have the junction point to Portal's login link - For some reason even though we're authenticated thru WebSEAL, you have to click "login" in Portal to obtain that token. That's cumbersome, so with the direct WebSEAL URL, we do it for them. But the bookmark issue is real.
    So basically, in a nutshell, I want to add some Javascript that says:
    1. Is there a User logged in to Portal from Portal's perspective?
    2. If yes, do nothing
    3. If no, redirect to the WebSEAL URL
    How would I do that? I can't read any span text or anything because the Login/Logout links do not have name/id parameters... Can I use #PORTAL.USER# inside Javascript?
    Thanks!
    Rick

    There is a package and function available that you might be able to incorporate
    in your JSP code to get the user that is currently logged in to Portal.
    The following URL provides the reference material
    http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1012/wwctx_api.html
    The package and function is: wwctx_api.get_user.
    Example Dynamc Page:
    <HTML>
    <HEAD>
    <TITLE>Example</TITLE>
    </HEAD>
    <BODY>
    <H2>Example of A Dynamic Page</H2>
    <ORACLE>declare
    theUser varchar2(30) := portal.WWCTX_API.get_user;
    begin
    if theUser = 'PUBLIC' then
    htp.p('<H1>Welcome! Please login.</H1>');
    else
    htp.p('<H1>Welcome ' || theUser || '</H1>');
    end if;
    exception
    when portal.WWCTX_API.NO_SESSION_EXCEPTION then
    htp.p('Error: Session not initiated.');
    when others then null;
    end;
    </ORACLE>
    </BODY>
    </HTML>
    Regards,
    Ersan

  • How to add a title to a JavaScript Confirm dialog box.

    function confirmDelete() {
    var msg = "Do you want to continue removing the items ?";
    return confirm(msg);
    Presently it says http://locahost:8080/says etc on the title bar for the dialog box. Instead I want to set the title as "Confirm Delete". How can I do this?

    You're talking about the document title as you set it in the HTML head? Just alter the title of the document accordingly in the same Javascript function.
    If you find Javascript hard, there's a nice tutorial at w3schools.com. And for Javascript related questions better use a forum devoted to Javascript. There are ones at webdeveloper.com and dynamicdrive.com.

  • Af:clientListener and javascript confirm() dialog

    Hi,
    a common requirement in most of our web apps is to include a warning dialog when a user tries to delete a record, ie. if someone presses on a link to delete a record they get a javascript dialog asking them "Are you sure you want to delete this record?'. Clicking ok will delete the record, while clicking cancel will cancel the action. Our jsp code from jdev 10.1.3 is shown below:
    <af:commandLink actionListener="#{bindings.removeRowWithKey.execute}"
              action="#{viewCalStatus.deleteCalStatus}" text="Delete"
                    onclick="return confirm('Are you sure you want to delete this record?');">
        <af:setActionListener from="#{row.rowKeyStr}" to="#{requestScope.calStatusRow}"/>
    </af:commandLink>We have noticed that in 11G <af:commandLink> no longer supports any javascript events such as onClick. The suggested replacement is to use <af:clientListener>, however, it doesn't look like the same functionality can be achieved. We tried the code below, however, when the delete link is pressed, the record is submitted for deletion before the javascript dialog shows up (which we kind of expected anyway). Is there any way of achieving the same javascript functionality using <af:clientListener>? If not, what is the suggested 'best practice' for achieving similar functionality?
    <script language="JavaScript" type="text/javascript">
        function confirmDelete() {
            if (confirm('Are you sure you want to delete this record?'))
                return true;
         else
                return false;
    </script>
    <af:commandLink actionListener="#{bindings.removeRowWithKey.execute}"
              action="#{viewCalStatus.deleteCalStatus}" text="Delete">
        <af:clientListener method="confirmDelete" type="click"/>
        <af:setActionListener from="#{row.rowKeyStr}" to="#{requestScope.calStatusRow}"/>
    </af:commandLink>Thanks,
    Michael.

    Hi Michael
    Hello from sunny Perth.
    I suspect (but don't quote me) what you're looking for is described in the entire section "3.9 Sending Custom Events From the Client to the Server" in the new Web User Interface Developer's Guide for ADF, available online with JDev 11g TP2.
    I've had some limited success testing this approach, to get a commandLink to call a client side JavaScript, display a message, and when the user clicks Ok, a server side backing bean method is called to do the rest of your work. It seems to work sometimes and not others, so I'm playing around with the config.
    As for "best practice," it's a little early to start asking this of a preview release isn't it? ;)
    Happy JDevelopering in Geelong.
    Regards,
    CM.

  • Javascript URL redirect (setting value) not working

    Hello All,
    Apex 3.1
    I am trying to write javascript that will execute off the click of an icon in a report. It will display a prompt box to the user, and when the user clicks "OK", I would like to re-direct the user to another page, setting the value in the prompt to a page item on the new page. Here is the javascript I'm trying to use:
    <script language="JavaScript" type="text/javascript">
    function copy_prompt()
    var copies=prompt("Number of copies?","1");
    if (copies!=null && copies!="" && copies !="0")
    $s('P6_ITEM_COPY_COUNT',copies);
    redirect('f?p=&APP_ID.:82:&SESSION.::NO:P82_ITEM_COPY_COUNT:&P6_ITEM_COPY_COUNT.')
    </script>
    The problem I'm having is that since session state is not being set, it is passing a null value to the new page. I can see on page 6 the item P6_ITEM_COPY_COUNT is getting set appropriately, but the value is not in session state. Any suggestions?
    Thanks!

    In trying the suggestion, I receive the following error when redirected:
    Error ERR-1002 Unable to find item ID for item "<value in javascript prompt>" in application "103".
    Thanks!
    SOLUTION: I looked at my URL syntax in the redirect statement, and was missing an extra colon (:) before the P82_ITEM_COPY_COUNT. Correct syntax is:
    redirect('f?p=&APP_ID.:82:&SESSION.::NO*::*P82_ITEM_COPY_COUNT:' + copies);
    Edited by: potter_geek on Dec 8, 2009 8:51 AM

  • Javascript confirm form jsf

    Hello,
    In my project I have to search for a person in two tables A and B. The search method in the backing bean should do something like this: search in table A, then in case the person was not found, prompt the user for confirmation on searching in table B.
    How can this be done with jsf?
    Thank you,
    Ioana.

    I'm sorry. I was not clear. I know I can use javascript from jsf. I want to use javascritpt from the backing bean.
    So in the action method I search table A, then ask for confirmation and proceed with table B or not, depending on the user's choice.
    Ioana.

Maybe you are looking for