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,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Any IDEA of Getting Server Time & RUn JavaScript Clock

    Hi ,
    Any idea of getting Server Time & running javascript Clock
    I tried using ..
    var tDate=<%=new java.util.Date()%>;
    But it is not working
    Plz help

    You can create a date in javascript like this
    new Date(year, month, day, hours, minutes, seconds, milliseconds) You don't have to supply all the parameters (this is javascript after all)
    Getting it from java, into javascript...
    <%
    java.util.SimpleDateFormat sdf = new java.util.SimpleDateFormat("yyyy,MM,dd,HH,mm,ss,SS");
    Date now = new Date();
    String sNow = sdf.format(now);
    %>
    var tDate = new Date(<%=sNow %>)

  • 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

  • Leopard Server Time Machine Questions

    We've been running Time Machine to backup client data for about 20 users for a number of months. We've set this up with Time Machine saving to a 750GB RAID 1 external drive mounted as a share point. Each user has a maximum disk quota on the share point (set up using 'edquota'). We now have some questions about how Time Machine is supposed to work:
    1) We're starting to get errors that Time Machine has run out of space for individual users. We understood that Time Machine would simply delete the oldest backups and then continue (as it does with standard Time Machine on an individual Mac) but this doesn't seem to happen. Instead we get a warning that there isn't enough space. Is this correct for Server-based Time Machine or is there something we can/should do to make Time Machine behave 'normally' and auto-delete oldest backups to make space for new backups?
    2) We've used 'edquota', 'quotacheck' and 'repquota' commands to create our user quotas on a share point. However we can't find any way of removing an individual user's quota completely - it seems we can change their quota but we can't remove them and start again without removing the user completely from the server. Is there any way of resetting and/or removing a user's disk quota on a share point, including clearing down all their data? For example, we have one user that has 3GB of 10GB quota 'in use' even when all their data has been removed manually. There are no hidden folders/files etc. but 'quotacheck says they are still using 3GB!
    3) We have an HP Ultrium 960 LTO-3 SCSI tape drive. Does anyone know how we can backup our Time Machine data onto these tapes for off-site archives? We've looked at EMC Retrospect 8.1 but this doesn't seem to work properly with Time Machine data (and seems to be generally flakey!). Does anyone know of general OS X/Unix drivers for this type of device that would allow us to use Unix commands ('tar' etc.). Alternatively can anyone recommend a backup software solution that actually works with Time Machine data?
    4) Can anyone recommend a known working solution to keeping long term archives of Time Machine data?
    Thanks for any help!

    Thanks for a quick response!
    We only backup selected client data, excluding system, apps, music, photos etc. i.e. only company data not personal data or general system data (our client systems are built from a common standard build brick). So 10GB-25GB is fine for many months of Time Machine backups for our user population.
    We like Time Machine because the user doesn't have to do anything for backing up, it works automatically and the user can recover their 'oops' files without tech support help. So we're keen to get the benefits of Time Machine for several months of immediate backups that users can deal with themselves, but also we'd like some kind of longer term off-site archive capability - this is why we'd like to tape the Time Machine data.
    We don't have a working tape solution at present. We have an old Retrospect 6 licence which explicitly does nothing (but complain!) with Time Machine data. We tried a trial licence of Retrospect 8.1 but it seems flakey in general and did not cope reliably with Time Machine data. We wondered about Bru but we'd have to remove Retrospect 6 (which we're keeping in case we need to recover from old archive tapes).
    Currently our server is backed up using a combination of techniques:
    1) Time Machine of the server itself (system and data)
    2) Time Machine of the company data share point onto an external 750GB RAID 1 drive (2 active disks mirrored + 1 spare disk)
    3) Weekly 'breaking' of RAID 1 mirror using a spare drive (i.e. weekly rotation of mirror drive)
    4) Weekly clones of server system material (but not data) onto FireWire external drive
    5) Monthly clone of RAID 1 onto another external FireWire drive (we intend to rotate this with another identical drive)
    Can you confirm the situation regarding Time Machine when it runs out of space - how do we get it to 'roll over' old backup data?
    Thanks again

  • Connection to server times out

    Hi, I know I've seen somewhere that you can set how long before your connection to your remote server times out in DW. After a few minutes of editing files, and then when I go to upload them to my host, It takes forever just to make a connection. I used CS3 for a while, then upgraded to CS5. CS3 didnt seem to have this issue.
    Another issue I seem to have is when I DO put files to my remote, sometimes the files dont seem to reflect changes I made. For instance, I added an id attribute to a firm field, uploaded my file to the remote, hard refreshed my browser viewing the same page and viewed source. The form field id was not there! So I clicked the expand local and remote files button and pulled the file over to the remote manually!
    Maybe these are issues with my hosting company? Anything I can do to ensure my remote connection stays connected, at least for an extended period of time if not indefinately. Thanks in advance!

    Hi Nancy, thats for the tips and info. I've tried most of what you suggested. One thing I never thought about though was toggling passive mode on and off. For some reason I just always assumed this should be on by default. So I will try that and see how it goes over the next day or so.
    Also the FTP optimize performance was checked. Seems like I had an issue with this a while back, so I unchecked it as well.
    Now the other issue of why updated files arent showing up on my remote. Yes I always use ctrl+F5 to refresh my browser. Again, this morning when I did that very thing, and then viewed source, the updated code was not there. The code I am referring to was about 20 lines of javascript that was showing in dw code view, but not in ff source view. So not sure about that one. As you said its possibly my host provider. Thanks again!

  • Part Time, Contract Based, and Full Time Positions available for LabVIEW Developers

    Mindready (www.mindready.com) is looking for flexible, hard working individuals to fill part time, contract based, and full-time/permanent jobs in LabVIEW development positions. We have immediate needs for contract labor in Dallas, TX; NY; Huntsville, AL and Austin, TX, as well as other locations.  US Citizen and Security Clearance required on some projects.   Mindready is a certified National Instruments Alliance Partner with facilities in Montreal, Austin, TX and (Radical Systems, Inc. – a mindready company) Huntsville, AL (www.radicalsystems.com).
    The duties of the positions include:
    • On and off-site LabVIEW development work.  May involve TestStand, instrumentation such as PXI and stand alone instruments, DAQ, Motion, Vision, etc.)
    • Willingness to travel for periods as short as 2-3 days, to as long as 6 months.  (Ideal candidate would be local to any long assignment)
    • Integrate into customer’s development team to design and modify new/existing LabVIEW applications. 
    The ideal candidate would possess the following skills & qualifications:
    • Intermediate-to-advanced knowledge of LabVIEW (a pre-employment test is required)
    • Broad technical knowledge is a plus, we serve a wide range of application areas
    • Excellent writing, communication (English), time-management, and interpersonal skills.
    • Ability to travel for on-site work at customer facilities for jobs as short as 1 week, possibly as long as 6 months.
    • Discipline and organization with respect to software development and maintenance.
    • Engineering, Technical or Computer Science degree or appropriate experience
    • Certification is not required but would be beneficial
    Pay is commensurate with skills and qualifications of the applicant.  Compensation will include a competitive hourly rate.

    Hi
    I completed my M.S in electronics engineering and working with GE in INDIA since June 2005. I have total 20 months of experience with LabVIEW and have the follwoing skills.
    Intermediate-to-advanced knowledge of LabVIEW.
    Ability to analyze empirical data against theoretical predictions to enhance and improve mathematical model of system.
    Familiarity with data acquisition concepts and hardware.
    Ability to work both alone and with colleagues to solve problems and to weigh the merits of differing approaches
    you can reach me at [email protected]
    Thanks & Regards
    Anil Punnam

  • Nearest time zones based on user time zone

    Hi,
    In my application, user accesses the applet in the browser and based on the user time zone I need to display the list of available server which are near to his time zone.
    Please provide me some hints on how to sort the time zones based on the time zone offset.
    Thanks
    Aravind

    Hi,
    In my application, user accesses the applet in the browser and based on the user time zone I need to display the list of available server which are near to his time zone.
    Please provide me some hints on how to sort the time zones based on the time zone offset.
    Thanks
    Aravind

  • Re-start Oracle 10g DB is required if server time is changed?

    I had a doubt that will a re-start of Oracle 10g DB be required if there is a change in server time? Our Server OS is RHEL 4.0(Linux). The server time is probably behind the time by 15 mins.
    I hope, my question is clear.
    Please, help in solving the doubt.
    regards

    Even though it is not required to stop/start the database when the OS time is changed, based on personal experience, I would highly recommend that you stop the applications and database before changing the OS time. We had Linux admin change the time once and mistakenly had the value for the year in the date out one year in the future. They caught the mistake quickly and reset to the to the proper date and time but the damage was already done. The time you spend fixing all jobs, especially if running Oracle applications where alerts and processes fire off thinking it is past time to run, is much less pain than scheduling a downtime for the time change and verifying the date/time befort starting things up again. It may be low risk and it up to you but it isn't fun trying to explain to the user community and management the reason that something like this happened.

  • SMS 2008 Server time out same time every hour

    Our server times out at the same time every hour. Any computer connected to our network at exactly xx:53, any program or anything you are attempted to do goes to the loading circle and says not responding. It stays that way until xx:54. Every hour, every
    day. However, nothing shows up on the error reports.

    Hi MNQWolfe,
    Based on your description, I suggest that you should firstly check if there any program or feature (such as antivirus program, update, backup and so on) started
    working at that time. Also, please monitor the Task Manager or Resource Monitor to check if any process was started at that time.
    In addition, it seems to be a network issue. Please run a sniffer on the server. You can use Microsoft Network Monitor 3.4 to monitor and then check ARP messages
    and so on.
    Microsoft Network Monitor 3.4
    http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=4865
    Hope this helps.
    Best regards,
    Justin Gu

  • Long Running Jobs based on average time of last 5 run

    Hi Experts,
    I need a query to find out the Long Running Jobs, based on average time of last 5 run.
    Could you please help me.
    Thanks in advance. 
    --------------------------------- Devender Bijania

    SELECT 
        [sJOB].[name] AS [JobName]
        , CASE 
            WHEN [sJOBH].[run_date] IS NULL OR [sJOBH].[run_time] IS NULL THEN NULL
            ELSE CAST(
                    CAST([sJOBH].[run_date] AS CHAR(8))
                    + ' ' 
                    + STUFF(
                        STUFF(RIGHT('000000' + CAST([sJOBH].[run_time] AS VARCHAR(6)),  6)
                            , 3, 0, ':')
                        , 6, 0, ':')
                    AS DATETIME)
          END AS [LastRunDateTime]
        , CASE [sJOBH].[run_status]
            WHEN 0 THEN 'Failed'
            WHEN 1 THEN 'Succeeded'
            WHEN 2 THEN 'Retry'
            WHEN 3 THEN 'Canceled'
            WHEN 4 THEN 'Running' -- In Progress
          END AS [LastRunStatus]
        , STUFF(
                STUFF(RIGHT('000000' + CAST([sJOBH].[run_duration] AS VARCHAR(6)),  6)
                    , 3, 0, ':')
                , 6, 0, ':') 
            AS [LastRunDuration (HH:MM:SS)]
          , CASE [sJOBSCH].[NextRunDate]
            WHEN 0 THEN NULL
            ELSE CAST(
                    CAST([sJOBSCH].[NextRunDate] AS CHAR(8))
                    + ' ' 
                    + STUFF(
                        STUFF(RIGHT('000000' + CAST([sJOBSCH].[NextRunTime] AS VARCHAR(6)),  6)
                            , 3, 0, ':')
                        , 6, 0, ':')
                    AS DATETIME)
          END AS [NextRunDateTime]
    FROM 
        [msdb].[dbo].[sysjobs] AS [sJOB]
        LEFT JOIN (
                    SELECT
                        [job_id]
                        , MIN([next_run_date]) AS [NextRunDate]
                        , MIN([next_run_time]) AS [NextRunTime]
                    FROM [msdb].[dbo].[sysjobschedules]
                    GROUP BY [job_id]
                ) AS [sJOBSCH]
            ON [sJOB].[job_id] = [sJOBSCH].[job_id]
        LEFT JOIN (
                    SELECT 
                        [job_id]
                        , [run_date]
                        , [run_time]
                        , [run_status]
                        , [run_duration]
                        , [message]
                        , ROW_NUMBER() OVER (
                                                PARTITION BY [job_id] 
                                                ORDER BY [run_date] DESC, [run_time] DESC
                          ) AS RowNumber
                    FROM [msdb].[dbo].[sysjobhistory]
                    WHERE [step_id] = 0
                ) AS [sJOBH]
            ON [sJOB].[job_id] = [sJOBH].[job_id]
            AND [sJOBH].[RowNumber] = 1
    ORDER BY [LastRunDateTime] desc,
             [LastRunDuration (HH:MM:SS)] DESC
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Confirmation based on a button with redirect

    hi
    Is there a way of getting a confirmation popup box to apear based on a cancel button. I also want the button to redirect to another page if the user clicks Ok.
    thanks
    Tom

    I now have the following code in the url target for the button. It redirects the user even if they press cancel. How do I only redirect when they press ok?
    javascript:confirm('Do you want to cancel?'),redirect('f?p=&APP_ID.:30:&SESSION.::NO'));

  • Displaying Live Server time

    I have a JSP page that i want to display a live display of the servers date and time (hours minute seconds)
    what would be the best way about doing this?
    thanks kindly
    Tom

    A quick google for javascript clock comes up with something:
    http://www.google.com/search?hl=en&q=javascript+clock&meta=
    http://www.javascript-page.com/clock.html
    The only thing that would have to change is to set the date as the server date, rather than the client date.
    var tDate = new Date(<%= System.currentTimeMillis() %>);This would be set to the server time at the time of serving the page. It would probably take a few seconds to transmit/render on the client machine.
    How accurate do you need this clock to be?

  • Time difference between local time and server time

    Hi Guys,
    I am currently experiencing a time difference of 40 minutes between the local time and the current server time.
    The local time seems to be 40 minutes slower than my current time.
    Path for Local Time : CMC -> home -> servers -> input.file repository sever -> metrics tab.  (Under the category of Installed on machine peacok, there is a local time.
    Question is how can i sync the local time with my current server time?
    Let me know if more info is required.
    Rgds
    Collin

    Hi Collin,
    Under  CMC >Home >Input FRS , the local time shown is current time of BO Server.
    Since CMC is web-based, any date, time value will be coming from BO Server box.
    u2022     In case your system and BO server is in same time zone  then update the date-time of BO Server
    u2022     In case your system and BO server is in different time zone then check with IT team to figure out the BO Server will be maintained in which time zone.
    u2022     If current requirement is specific to some report then you can add 40 min in all date value in report to get the desired result.
    Thanks,
    Sushil

  • Registering Values in Audit Database as per server time

    Hello Experts,
    We have a requirement for values in Business Objects auditing database being entered or registered as per Server time(CDT) and not GMT.
    I understand by default its registered as per GMT time,so whatever entries are made, are converted to GMT time first and then entered in audit database.I want the entries to be made as per CDT without converting to GMT. Please let me know if this is possible or a workaround is available for the same.
    Thanks and regards,
    Abhishek

    First go through this KBA:
    1736216 - Audit Reports based off of Activity Universe show incorrect data due to audit database storing dates in GMT time zone
    Then if required go through these:
    1338736 - Time Zone Issue with universe using Audit database tables.
    1359599 - MySql Convert UTC GMT to PST

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

Maybe you are looking for

  • HP Officejet Pro 8610 - Extremely slow printing

    Hello,   I have just purchased my new HP 8610 All in one printer. I have set everything up wirelessly. For some reason when I print documents it is extremely slow printing. I cant seem to find the problem for this. For a 5 page documents it could tak

  • My MacBook and IMac won't download new iTunes 11.1?

    For Christmas I received loads of CDs. I also received an iPhone 4. I have a PowerBook G4 and an older iMac model. When I went to load the new CDs onto my new phone for the first time, it came up with text saying I needed an iTunes Store update for 1

  • Cl_gui_frontend_services= file_exist is not reading files from C drive

    Hi experts , I am using the method 'cl_gui_frontend_services=>file_exist' to check whether a file exists in frontend machine or not. This method works fine and gives corerct result when i keep the file on desktop and provide the path of the files as

  • How to authorize ebook reader in Adobe Digital Editions?

    I downloaded Adobe Digital Editions from the website so that I can borrow ebooks via the public library system.  I was able to authorize my computer, but can't figure out how to authorize by ebook reader (Kobo Touch) - without authorizing the device,

  • Music preview issue after downloading iOS 6

    Yes, after I downloaded iOS 6 to my iPhone 4S, I have been unable to preview songs in the iTunes Store.  I tap on a song I want to preview, and the stop button loader appears, but disappears immediatly afterward.  Ever since iOS 6, I have been unable