Javascript Alert function

Hi,
i have inserted an .js file in my project and imported it, the file is correct and the function is called too, but it alway retur an error, and i dont know why
i have put this imn my onclick event JSF html button:
onclick='javascript:newConfirm( "Remove records","Delete selected records?", 1,1,0)'
in my .js file i have this function
js file
function newConfirm(title,mess,icon,defbut,mods) {
IE4 = document.all;
if (IE4) {
icon = (icon==0) ? 0 : 2;
defbut = (defbut==0) ? 0 : 1;
retVal = makeMsgBox(title,mess,icon,4,defbut,mods);
retVal = (retVal==6);
else {
retVal = confirm(mess);
return retVal;
do i´m doing something wrong ?? i´m using IE and it doesnt work, if i use Mozila it works fine...
cheers,
Epsy

Hi,
does it go into the
if(IE4) loop at all ?
Frank

Similar Messages

  • JavaScript Alert functionality in PL/SQL

    I'm in need of implementing the JavaScript "Alert" functionality (display message and wait for user to acknowledge) in the "before displaying the page" PL/SQL block of portal reports and forms. While I'm at it - How about the JavaScript "history.back" function as well?
    Is this possible? Can you point me in the right direction.

    Hi,
    Where Portal says "before displaying the page" what it means is that it will run this code before it starts to htp.p() out the HTML of the page.
    In WebDB this was actually what happened, in Portal there are some elements of HTML output BEFORE this block of code is run.
    Anyway I don't think that you can have an alert that displays before the page is loaded. The page will still show behind the alert.
    To get around this you would need a blank page to show your alert that forwards you on to the required page.
    The history function can be called by the onclick event of a button or you can access Javascript through an anchor tag:-
    link text
    Regards Michael

  • Javascript alert wiping page clean - HELP

    Hi - I am using the javascript alert function in order to tell a user that information entered on a form is incorrect - however, the alert makes the page go away when all I want is to return to that page so the user can correct just that piece of information and resubmit it
    Anyone have any ideas on this? I'm scratching my head over this!!
    Thanks!
    Beth

    Hi Savitha,
    Yes, you are right, there is difference between alert and confirm. I will pose a small example, I have a page where the user / client must(!!!) enter his name, otherwise I don't allow him to go further (to my next page). Here in Javascript I will check for the name field,
    if(confirm(document.myform.field_name.value)) {
    //submit the form
    }. Here user didn't enter anything and clicks on 'OK' in confirm dialog, then I am forced to take him to the next page. So, I don't want to provide that chance to the user and decide it programatically, but prompt the user to enter the name with an alert dialog.
    Hope I am clear.
    PS:-
    I have shown a sample statement in the form of document.myform.field_name.length==0;
    'You can do all your validations there', is what my point here.

  • Invoke Javascript alert withing a PLSQL Function Block

    Hello,
    I am having trouble trying to achieve the following functionality. I have a page with an update button. On submit of this update button I have created a PL/SQL Function Body which returns TRUE for CASE 1, and FALSE for CASE 2. If CASE1 is achived then the process will update the data in the underlying table and will do nothing for CASE2. What I simply want to do is for CASE2, I also want to throw up an Alert informing the user that he is in CASE2. My existing PL/SQL function looks something like:
    BEGIN
    IF CASE 1 THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END;
    I want something like:
    IF CASE 1 THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    javascript:alert('Update did not work!');
    END;
    Can anybody help me?
    Thanks
    Mitesh

    If you have submitted the page it is too late for javascript to run, javascript runs in the client, and the pl/sql runs on the server. If you want that to popup at that point you will need to have it popup on onLoad of the resulting page. Or do all of the validation in javascript then have javascript submit the page.

  • JavaScript alert in AS3 or AS2 to debug the external actionscript file

    Hi,
    Is there any way to debug the external AS file as i dont want to use "trace".
    I have an idea to use the input text field the check the variable/function is working right but this is not enough so is there any process in AS2 or AS3.
    Thanks in advance..

    my mistake ..i have used there dynamic textfiled.
    but i got a easy solution by using
    getURL ("javascript:alert('Testing');");
    but this is not the good solution
    is there any way to import the alert contolls in AS2
    like i have read somewhere
    import mx.controls.Alert;
    Please reply..

  • Javascript:alert(1);

    javascript:alert(1);

    The first thing you have to do is to remove the ColdFusion conditional logic.  ColdFusion runs on the server.  JS runs on the client.
    The next thing is to call the function from an event that happens on the web page.  form onsubmit seems like a good choice.

  • Javascript alert problem - select state

    I am trying to validate my form with javascript. I'm having
    trouble with my state field. If the user selects a state javascript
    alerts the following message: "SELECT ONE is not a valid choice.
    Please choose your state." I want the alert message to pop up if
    select one is selected as a state. How do I fix this problem?

    pqer wrote:
    > I am trying to validate my form with javascript. I'm
    having trouble with my
    > state field. If the user selects a state javascript
    alerts the following
    > message: "SELECT ONE is not a valid choice. Please
    choose your state." I want
    > the alert message to pop up if select one is selected as
    a state. How do I fix
    > this problem?
    >
    >
    >
    > <script language="javascript"
    type="text/javascript">
    >
    > // check to see if the form is blank
    > function validForm(contactUs) {
    >
    >
    > if(contactUs.state.value != "SELECT ONE") {
    > alert("SELECT ONE is not a valid choice. Please choose
    your state.")
    > contactUs.state.focus()
    > return false
    > }
    if(!contactUs.state.selectedIndex) {
    alert("SELECT ONE is not a valid choice. Please choose your
    state.");
    contactUs.state.focus();
    return false;
    Mick
    >
    > </script>
    >

  • Javascript Alert

    How do I replicate the following AS2 function in AS3 completely in Flash WITHOUT writing any external javascript
    myBtn_btn.onRelease = function(){
    getURL("javascript:alert('you clicked me')");
    I know about the ExternalInterface option, but again I need to do this without creating/changing any external Javascript code.
    Thanks

    A slight tweak on kglads code to make it work with the security restrictions of the newest players.
    myBtn_btn.addEventListener(MouseEvent.CLICK,f);
    function f(e:MouseEvent):void {
         ExternalInterface.call("alert","you clicked me");
    This works without putting any JS code on the HTML page because the alert() function is native to JS.
    Also, if you want to do more elaborate things (custom functions, etc) - here is a tutorial on JS script injection with AS3:
    http://www.actionscript.org/resources/articles/745/1/JavaScript-and-VBScript-Injection-in- ActionScript-3/Page1.html

  • How do i save the source code of a javascript alert in safari?

    I am trying to save the source code of the javascript alert in safari but the menu items blank out.
    Is this even possible?
    dave

    Eventhought it is a usefull function which i did not know about it is not helping me. This is what hapens.
    I request an url and get a javascript alert back from the server. The javascript alert triggers that is i get a popup where I can only press ok. If i do not press ok i can not do anything else. the safari menu's are greyed out. if i do press ok i get redirected and i can not read the javascript page with your suggestion.
    what i want is read the source for that javascript alert so i know what it says (my filemaker database that is) but because that option is greyed out i am stuck.
    here is the link i use to get the javascript popup:
    https://www.login.alex.nl/klanten/portfolio/portefeuille-xls.asp?print=true
    the javascript says i am not loged in.
    if i get this javascript alert in firefox i can ask for the sourcecode, read it and do stuff that is log in. I just do not understand how i can change safari so it does the same thing as firefox.
    thanks again

  • Using JSP variable inside Java Script's alert function.

    Hi Gurus,
    We are trying to use alert function with one of the string variables populated inside JSP code, but its not working.
    Here is the code snippet, please advice.
         <%
         oracle.apps.qot.util.RequestCtx.log("qotcustom.jsp",AOLMessageManager.getMessageSt(QotUtil.QOT_APPS_CODE, "XDPYY_DISC"));
         %>
         var alert_text="<%=AOLMessageManager.getMessageSt(QotUtil.QOT_APPS_CODE, "XDPYY_DISC")%>";
         alert(alert_text);
         Here in the first line we are using API to get text message defined in database, the line is getting executed properly and we could see output text message in debug log file, after this in the 4th line, we are assiging this string output of API to java script variable alert_text and further using alert function with the variable alert_text as argument. But alert function is failing, no errors are thown in debug log file.
    Please advice whether we are doing any thing wrong.
    Thanks in advance.

    What pgeuens means is that you can't mix javascript and jsp/java code in this way.
    ALL of the jsp/java code gets executed at the server end.
    This produces an HTML page (with embedded javascript) which gets sent to the client.
    The client then runs javascript code in response to events (onLoad, onClick, onChange etc etc)
    So in this case, the jsp:forward will always be executed, because as far as the server is concerned, the javascript is just template text.
    If you WANT to do a conditional forwarding on the server side you do it in java ie (horribly using scriptlet)
    <%
    if (testCondition){
    %>
      <jsp:forward>
    %<
    %>Or if you want to test what the client has entered client side, all you can do is submit the form, or navigate to a URL
    <script>
    function test()
    if(document.f.htemp.value=="true")
    alert("jus");
    else
    var s=document.f.htemp.value;
    alert(s);
    document.f1.action="success.jsp";
    document.f.submit();
    </script>You cannot run JSP code based on your javascript code.
    Java. Javascript. Not the same thing.
    Hope this helps,
    evnafets

  • Is there a way to use SPD workflow to enhance the alert function in a SharePoint list?

    I have a request to achieve this:
    the Alert function in a list only allows a user to get alert when anything changes or created, but there is no way to specify notification before a certain field date.  For Example,   users want to be able to choose to receive a reminder
    10 days before expiry date.
    The requirement:
    1) A user can set a reminder if they wish  - so cannot be systematic automatic reminder
    2) A user can choose how many days before expiry to receive reminder
    I tried workflow by adding additional columns to set the user name to receive reminder and # of days before expiry day to send reminder.  But that setting can only apply to one user at time, and the user has to set one item at time, e.g. if user A sets
    5 days prior for the reminder on an item. then user B changed it to 4 days, then user A's setting if overwritten.
    So this is really a customization of the alert function, but wonder if it can be achieved by workflow created in SPD (or NinTex?)
    Thanks in Advance for any tips!

    One option i can think of is, you can set the Create and Edit access: in Advanced Setting from List setting to Create items and edit items that were created by the user, so that other users can't override the items created by other
    users.
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • OBIEE 11g: Dashboard not invoking simple javascript alert

    Hi Experts,
    I'm trying to invoke one simple ALERT command with javascript in obiee 11g dashboard. The purpose is when it loads, it should print one ALERT message and also when we change something in the prompt and clicking Apply button.
    Here is code written in a text item (Checked html markup option) after prompts;
    <script language="Javascript">
    alert ("Hello");
    </script>
    The Javascript alert message is showing when the dashboard page loads, but its not coming when we click the Apply button after changing the prompts.
    Can anyone give helpful hint, how to check it and why its not showing up when we press Apply button?
    Any hint or some useful links will b highly appreciated.
    Thanks in advance.

    You just used code and I would say the default event is onload of the page, thats the reason you are able to see alert.
    Since you didnt ask or written code onClick event to show alert, its not showing.
    You need to tell to browser when to prompt alert message instead of onload.
    Hope you are more confuse about 'how to do'
    if yes, mark :)
    give some more info about your actual req. that helps any other gurus to help.
    Edited by: Srini VEERAVALLI on Mar 27, 2013 8:42 AM

  • Javascript alert boxes are wrapped in Windows 7 with IE 8

    I can't count the number of JavaScript alert boxes I have throughout my systems and they have always made the transition between IE browsers from 6 to 8 without a hitch.  Without a hitch until I setup my first Windows 7 machine.  It is a 64 system that has both 32 & 64 bit IE browsers.
    It doesn't matter which of the two versions I use, the JavaScript messages that I have so carefully crafted with just the proper layout are now wrapped.  The resultant text in the new W7 popups is almost unintelligible because it is so badly scrambled/wrapped on the new white background.
    Since an alert box is simplicty itself, there is no way that I can think of to change the inherent size of the box.
    Has anyone else notice this phenomena???   If so, do you have a way around it short of redoing all of the text in the effected boxes???
    Len
    XP machine's JavaScript Alert popup in IE 8
    W7 machine's JavaScript Alert popup in IE 8 with wrapped text

    HMM I have the same problem. My researches suggest that the Zone.Identifier ADS is still being used for the internet zone, but not the Intranet zone. I too can get an intranet location out of IE, but not by querying Zone.Identifier eg using Powershell. This
    issue is present in XP as well as Win 7. It appears to extend to trusted zone ids.
    One hypothesis is that this is being stored in hidden form to prevent zone ids that decrease security being applied by malware.
    I had thought that maybe the intranet zone id was only present during download - but your experiment suggests otherwise.

  • How to verify JavaScript alert message display on page with C#?

    Hi All,
    I have a question about verify the JavaScript alert message on page. For example, I input the script in browser address like: "javascript:onmouseover=alert('popup windows')" . How to verify there's a alert message displayed on page with C#?
    Thanks

    Are you trying to use some automation or ? What the previous solution is they have put the text in the dom for you to pull out with C# or other languages.
    if you are trying to automate this through a browser maybe look into WebDriver
    WebDriverWait wait = new WebDriverWait(driver, 2);
    wait.until(ExpectedConditions.alertIsPresent());
    Alert alert = driver.switchTo().alert(); var alertText = alert.Text;
    alert.accept();

  • Not able to display javascript alert message from within a pl/sql block

    Hello,
    Can anyone please help me out with this issue. I wanted to display an javascript alert message from within a pl/sql block for an update button. Below is sample code which i am using. P1_ITEM is my hidden item on the report.
    begin
    if :P1_ITEM IS NOT NULL then
    HTP.p ('<script type="text/javascript">');
    HTP.p ('alert(''Please complete the item which is already assigned to you!'');');
    HTP.p ('</script>');
    end if;
    end;
    and I have made this code to be executed conditionally when request = Expression1
    Expression1: SUBMIT
    The thing is I am not able to display an alert message when the update button is clicked.
    Can anyone please help me with this one.
    Thanks,
    Orton

    varad but I also have an update statement within that block for the update button something like this i want to achieve.
    begin
    if :P1_ITEM IS NULL THEN
    update sample_tbl
    set col1 =:APP_USER,
    col2 = 'Y'
    where pk_col = ---;
    commit;
    HTP.p ('<script type="text/javascript">');
    HTP.p ('alert(''Successfully assigned an item!'');');
    HTP.p ('</script>');
    end if;
    if :P1_ITEM IS NOT NULL then
    HTP.p ('<script type="text/javascript">');
    HTP.p ('alert(''Please complete the item which is already assigned to you!'');');
    HTP.p ('</script>');
    end if;
    end;
    thanks,
    Orton

Maybe you are looking for

  • How to suppress a Security Notifcation for all users

    How can we suppress the notification If you open this document, anonymous usage data will be sent securely to this remote server: To learn more about what this means for you, please click on the 'Privacy and Security' button. check box - Allow collec

  • How to add columns for wad in web apllication designer

    hi, can any one tell me how to add new columns for analysis item in wad. i found an option of adding new rows but not able to find a option of new columns in analysis item. please suggest me. i will assign points

  • Motion 3 feature?

    Does anyone know if Motion 3 allows for EPS importing or if it still requires the creation of a PDF. Everything else about version 3 looks very cool.

  • Unable to download plug ins

    I use Windows XP, I have both Photoshop 7.0 and Elements 4.0. I've been trying to download plugins for my Canon EOS Rebel to access RAW (Cr2) files and every time I download I get an error message either that the file is corrupted or that the ZIP ext

  • Spreadsheet opens sometimes 10g

    We have a form kicker in 10g that runs a report. If the user chooses SPREADSHEET, it will open as a spreadsheet. This works for some of our PCs, but on others, a window will appear and disappear in an instant, not allowing us to view the spreadsheet