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.

Similar Messages

  • TS1541 I took my iMac to the store and they wiped it clean and helped me reinstall from a back up but we did not have time to finish the reinstall of all the pictures, when I got home I followed the directions and ii got a message saying that I am nadmini

    I was having problems with the software and iTunes, took the iMac to the apple store and they wiped it clean and then helped me restore from my backup. W were able to do most of it but had the pictures left, and it would take to much time, so they sent me home with instructions, I followed the instructions to the letter but got a message saying that the pictures could not be installed because I was not the administrator and I am stuck, can someone out there help me?

    Go to System Preferences/Accounts
    Click on your name
    Select 'Allow user to administer this computer'

  • 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();

  • 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

  • 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

  • Required = true, but Javascript alert boxes Does Not fire ?

    Hi,
    On my ADF Form (af:form), I have set my attribute : required = true on the adf faces page. (on the entity object, mandatory = true)
    But when I press Submit, I do not get any Javascript alert boxes fired, instead, I just see server side validation error.
    Why the Javascript alert boxes does not get fired ?
    Where is the setting ?
    Thank you for your help,
    xtanto

    Hi Frank,
    I use JDev 10.1.3.1 and it does not work.
    Yes , the required field similar to #{bindings.ManagerId.mandatory}
    I even try to change it to 'true', still no Java script alert, just the server side error.
    What is the possibility ?
    Thank you,
    xtanto

  • Javascript to move page from page library to document library

    hi friends
    my scenario is.
    i have to move page from page library to another library using only javascript.
    is it possible please help me.

    my working code
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
    var _ctx;
    var _sourceFile;
    var _destinationlibUrl;
    var _destinationFile;
    var targetListItem;
    var itemId=10;
    $(document).ready(function () {
    $("#Archive1").on("click", function(){
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', CopyFile);
    function CopyFile() {
    //_ctx = new SP.ClientContext(siteUrl);
    _ctx = new SP.ClientContext.get_current();
    // Get the Web site that is associated with the client context.
    this.web = _ctx.get_web();
    _ctx.load(this.web);
    // Returns the list with the specified title from the collection.
    this.sourceList = this.web.get_lists().getByTitle('Pages');
    _ctx.load(this.sourceList);
    // Get the list items being selected.
    //var selectedDocuments = SP.ListOperation.Selection.getSelectedItems(_ctx);
    //this.currentItem = sourceList.getItemById(selectedDocuments[0].id);
    this.currentItem = sourceList.getItemById(itemId);
    _ctx.load(this.currentItem);
    // Get the file that is represented by the item from a document library.
    _sourceFile = this.currentItem.get_file();
    _ctx.load(_sourceFile);
    _ctx.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded),
    Function.createDelegate(this, this.onQueryFailed));
    // Delegate that is called when the query completes successfully.
    function onQuerySucceeded(sender, args) {
    if (_sourceFile != null) {
    _destinationlibUrl = web.get_serverRelativeUrl() +'/PageArchive/' + _sourceFile.get_name();
    alert('Now moving to: ' + _destinationlibUrl);
    //_sourceFile.moveTo(_destinationlibUrl, 1);
    _sourceFile.copyTo(_destinationlibUrl, 1);
    notifyId = SP.UI.Notify.addNotification('Moving file ' + _sourceFile.get_serverRelativeUrl() + ' to ' + _destinationlibUrl, true);
    _ctx.executeQueryAsync(
    function (sender, args) {
    SP.UI.Notify.removeNotification(notifyId);
    SP.UI.Notify.addNotification('File copied successfully', true);
    // window.location = web.get_serverRelativeUrl();
    function (sender, args) {
    SP.UI.Notify.addNotification('Error copying file', false);
    SP.UI.Notify.removeNotification(notifyId);
    alert('Error occured: ' + args.get_message());
    // Delegate that is called when the destination file checkout completes successfully.
    // Delegate that is called when server operation is completed with errors.
    function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>

  • 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 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

  • 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

  • Javascript Alert on download setup

    I just purchased Adobe Elements 6.0 for my IMac and have previously used a trial version. I have successfully downloaded the program, but when I run the setup file I get this error  "Javascript Alert: Critical errors were found in setup. Incompatible payloads already installed. See setup log file for details." I am assuming this error is because I have had a previous trial version on my computer.... I have tried deleting/uninstalling the older programs, but I don't know if I have found all of the old files, or if this is even the problem...also, my serial number is not working...I think this is also related to the old trial version... can anyone help with this???

    Hi,
    There is a known issue with installing retail version of PSE 6 on trial version. Removing files manually doesnt actually remove all the files, there are still some files which we do not directly relate but still need to be removed.
    You can follow the below link to get rid of the issue:
    http://kb2.adobe.com/cps/403/kb403796.html
    Let me know if this helps.
    Cheers,
    Ankush

  • Javascript alert script needed when calculation does not equal 100

    I have created a fillable form and have a total box which I've set to calulate the sum of Field1, Field2, Field3 and Field4
    which works well.
    I would like to add a javascript alert if the total amount does not add to exactly 100 to stop the user submitting the form or moving to next question.
    Any help would be greatly appreciated
    Thank you

    Hi try67,
    I have implemented successfully the following:
    event.value = ''; // clear field
    // get the values of field 1 and 2 as string
    var sField1 = this.getField("field 1").value.toString();
    var sField2 = this.getField("field 2").value.toString();
    // adjust for a field being 100 and the other is null
    if (sField1 == 100 & sField2 == '') sField2 = "0";
    if (sField2 == 100 & sField1 == '') sField1 = "0";
    // do only if field 1 and 2 are not null
    if(sField1 != '' & sField2 != '') {
    event.value = Number(sField1) + Number(sField2);
    if (event.value != 100) app.alert("Fields 1 and 2 must sum to 100!", 1, 0);
    } // end not empty
    Just wondered if you can let me know what I need to add to stop the form being submitted(email submit button) if the amount is not 100?
    So the same alert appears ("Fields 1 and 2 must sum to 100!")
    Currently if the fields exceed or are below 100, then the alert message  ("Fields 1 and 2 must sum to 100!")
    appears once and you can still tab to next field, or click on next field or submit the pdf.
    I was hoping to add validation on submitto be similar to required fields where you are alerted if not filled in and cannot submit until you imputted the correct calculation sum up to 100?

  • 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 in Web Planning - timing when it pops up?

    Hi all,
    Javascript alerts such as
    alert('Layout not available, check your header combinations?')
    are easy to set up using the text component (html=true) in the web interface builder.
    My problem is that when using 'Tabs' (tab component), if you navigate between the tabs and your alert condition is activated, then the alert appears BEFORE the rest of the screen is rendered.
    Normally, the use of the 'onload' html statement in the <body> tag allows one to ensure some event only happens AFTER the entire page is downloaded/rendered into the web, but, because of the nature of our web BSP's used for planning web interfaces, it is really difficult to influence this html attribute.....!!
    In simple words, on navigation from one tab to another, does anyone out there know how to make my popups only popup AFTER all images have been rendered into the web page.....rather than BEFORE......??
    My guess is not one of you even know what I am talking about, eh?
    Many regards,
    Rael

    Rael, there was a lot of requirements through my personal experience, which cannot be accomplished fully in WIB. And very often these requirements were very critical to client.
    So just all web-planning applications, that I did, were extended through se80.
    And this is quite normal approach, because even SAP itself recommends development of own planning interfaces in case of complex requirements to user interface.
    >because the changes can be lost
    The necessary additions: buttons, layouts and so on can be made manually in se80 at any time later.

  • Javascript alert stops button firing in IE

    This isn't really an Apex issue, it seems to be the way IE works - but I wonder if anyone has a work-around?
    1) I have an item with an onchange event that displays an alert - e.g. onchange="alert('Hello');"
    2) I have a button SUBMIT that submits the page in the usual way.
    If I enter some data in the item, then move the mouse over to the SUBMIT button and press it, the onchange event fires and displays the alert. However, the SUBMIT is not performed, so I have to press the button a second time. Annoying, really. In Firefox it works fine.

    Tony,
    I'm curious if this would work:    onChange="javascript: return showAlert();"Or maybe even more simply back to your orginal onchange:   onChange="javascript: Alert('Hello'); return true;"--Jeff                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for