Same script..works in one form but in another keep getting "Date is not a constructor" error.

Using this javascript in one of my forms to timestamp it, (just a simple protected text field.)
form1.MainPage.DateTimeStamp::docReady - (JavaScript, client)
if (form1.MainPage.DateTimeStamp.rawValue == null) {
        var now = new Date();
        form1.MainPage.DateTimeStamp.rawValue = nowtoDateString() + now.toTimeString();
This timestamps the form as it should.  The problem is on another form I'm building I'm using the identical script, (with different absolute paths of course,) and I keep getting a javascript error about date not being a constructor.  I've type the script in ten bajillion times and I'm at a loss for what is causing this.
All I want is a simpel javascrip where I can display the time/date from the users system in a text field.

Hi,
You are missing a . inbetween "now" and "toDateString()"
Also you can simplify the script as it is in the docReady of the textfield:
if (this.rawValue == null)
     var now = new Date();
     this.rawValue = now.toDateString() + " " + now.toTimeString();
Hope tht helps,
Niall
Assure Dynamics

Similar Messages

  • Exact same code works in one class, but gives me a fatal error in another

    I'm feeling around in the dark like the blind noob I am trying to get a GUI to work, but this one very confusing thing is preventing me from getting anywhere. When I ran a very simple start to the program, I got a message that said: "Fatal exception occurred. Program will exit." The command line said the oh-so-helpful:
    java.lang.NoSuchMethodError: main
    Exception in thread "main"
    with no more details than that. I have spent about an hour testing different things to find out what the hell is wrong, when I discovered that if I copy-paste the code into a new class in the same package, it works. What is going on? I'm using Eclipse. Here is the code:
    public static void main(String[] args) {
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.getContentPane().add(new ExitImpossiblePanel());
              frame.setSize(300,300);
              frame.pack();
              frame.setVisible(true);
         }

    masijade. wrote:
    georgemc wrote:
    masijade. wrote:
    codinatrix wrote:
    Oh, I see. I had that class open and pressed the "Run" button. I thought that meant it would run the one it had open. I guess it was trying to run the panel class instead. Wow, I spent all that time on such a dumb mistake.
    It happens. ;-)It does indeed. I had the exact opposite thing happening to me the other day with some new distro of Eclipse 3.3 (Europa, I think) that decided it would - as our friend here expected - try and run main in the compilation unit in view. It's configurable in that version, but I've never needed to change it beforeI am definately going to have to watch out for that then. We currently have 3.2 here, but they perform updates at random and without warning (at least as to what, if not when) here.
    ;-)I suspect it was a buggy plugin, because it's only that particular distro that does it, no other 3.3 release I've used does so

  • Script works in one frame, but not with frames before it

    Hi all-
    I'm a complete AS/Flash n00b, but hoping that I can get some guidance on this.
    I'm trying to test a very simple function for an e-learning module that is to train people on using 'quick keys' or key combinations on their keyboard. Basically, I want to show them a command and have them practice. In the practice, they will be asked to use a command and then have to do it on their keyboard.
    I used the code below successfully with one frame and a couple layers. I created a text-area ("traceArea), put it on the stage, set up the event and function... it works great! (although I'm sure the code isn't very pretty) When anything other than ctrl-p is pressed, it traces the "Try again!" message and when ctrl-p is pressed, "Great job!" pops up.
    stop();
    stage.addEventListener(KeyboardEvent.KEY_DOWN, detectKey);
    function detectKey(event:KeyboardEvent):void
    if (event.ctrlKey== true && event.keyCode==80 )
    traceArea.text = "Great job!";
    else
    traceArea.text = "Try again!";
    So, then I tried to build on to the file and added two frames before the previous AS code.
    Frame 1 - Intro
    A short introduction to the 'module' with a continue button. The code for this frame is:
    stop();
    continueBtn1.addEventListener(MouseEvent.MOUSE_UP,buttonPressed);
    function buttonPressed(event:MouseEvent)
    nextFrame();
    Frame 2 - Instructions
    This frame shows the viewer the correct keys to use to print (ctrl-p). There is another continue button here. Code:
    stop();
    continueBtn2.addEventListener(MouseEvent.MOUSE_UP,buttonPressed);
    The last frame is then the 'practice' (see first code above).
    When I run this file, there are no errors, but when it gets to that last frame, nothing is traced and there is no output on any keyboard command. I know the solution must be pretty easy, but I'm missing it and have no idea what it might be!
    Any help is appreciated. Thanks!
    -Andy

    use the trace function to debug your flash code:
    stop();
    stage.addEventListener(KeyboardEvent.KEY_DOWN, detectKey);
    function detectKey(event:KeyboardEvent):void
    trace(event);
    if (event.ctrlKey== true && event.keyCode==80 )
    traceArea.text = "Great job!";
    else
    traceArea.text = "Try again!";

  • Script works for one frame but not another

    I set up 2 keyframes, each one loads a different text file
    into a dynamic text box. The text box for the first keyframe is
    named "session" and the text box for the second keyframe is named
    "oneptq". The text file for the first text box is named Titles.txt
    and the text file for the second keyframe is 100Q.txt. The code I'm
    using is identical (except for the respective names of the text
    boxes and text files) but for some reason the text will load in the
    first text box but not the second.
    Here's my AS for the first keyframe:
    lvLoader = new LoadVars();
    lvLoader.onLoad = function(success)
    if(success)
    session.text = lvLoader.textbody;
    lvLoader.load("Titles.txt");
    And my AS for the second keyframe:
    lvLoader = new LoadVars();
    lvLoader.onLoad = function(success)
    if(success)
    oneptq.text = lvLoader.textbody;
    lvLoader.load("100Q.txt");
    I can't figure this thing out. Please help. Thanks.

    Have you double checked that it's a DYNAMIC text box? Maybe
    it was accidentally swapped by to static at some point...

  • TS2363 I am trying to update I Tunes to 10.6 but keep getting 'itunes was not installed correctly. error 7

    I have plugged in my Ipod and performed the update, at the end it said Itunes has not installed correctly, please reinstall Windows error 7 (error 5) any odeas how I can fix this I cant put my new music on my playlists without the upgrade

    Refer to this article:
    iTunes for Windows: "Error 7" message when opening iTunes
    http://support.apple.com/kb/TS3074

  • Airplay works for one user but not for another on the same machine

    I have the problem where airplay works for one user but not for another and both users are on the same machine.  For the user where it does not work, everything appears normal, it's just that there is no sound being transmitted.  I have tried restarting the Airport express, restarting iTunes, repairing disk permissions.  Any ideas about what can be done to resolve this?

    my /etc/group:
    root::0:root
    bin::1:root,bin,daemon
    daemon::2:root,bin,daemon
    sys::3:root,bin
    adm::4:root,daemon
    tty::5:
    disk::6:root
    lp::7:daemon
    mem::8:
    kmem::9:
    wheel::10:root,hans,ibm,gast
    ftp::11:
    mail::12:
    uucp:x:14:
    log::19:root
    locate:x:21:
    smmsp::25:
    http::33:
    games::50:
    network:x:90:
    video:x:91:
    audio::92:ibm,gast
    optical::93:hal
    floppy:x:94:hal
    storage:x:95:hal
    scanner:x:96:
    power:x:98:
    nobody::99:
    users::100:gast
    dbus:x:81:
    hans:x:1001:
    vboxusers:x:108:hans
    policykit:x:1002:
    hal:x:82:
    kvm:x:78:
    nx:x:85:nx
    avahi:x:84:
    camera:x:97:
    gdm:x:1003:
    gast:x:1004:

  • Script works on one site, not the other... why?

    Could someone tell me why this prototype-based lightbox seems
    to work on one
    site but not on the other?
    I literally took the exact same .js & css files, copied
    them over from one
    site to the other, but it's only partially working on the new
    site.
    http://www.vilverset.com/sample.html
    And the original fully-functional one :
    http://www.roxanacampagiorni.com/
    Been troubleshooting this one for days, and I'm stumped.
    Script wants
    nothing to do with lightboxing HTML files on the new site.
    Only straight
    JPGs.

    "Michael Fesser" <[email protected]> wrote in message
    news:[email protected]..
    > .oO(Mark A. Boyd)
    >
    >>Strange. I don't think I've ever seen these headers
    before:
    >>
    >>
    http://www.vilverset.com/tn_posters.html
    >>POST /tn_posters.html HTTP/1.1
    >>HTTP/1.x 405 Method Not Allowed
    >>Allow: GET, HEAD, POST, PUT, DELETE, CONNECT,
    OPTIONS, PATCH, PROPFIND,
    >>PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK
    >>
    >>I suspect a server configuration - or version.
    >
    > I consider it a script problem. Why does it send a POST
    request instead
    > of GET? IMHO the server's response is correct, because
    it doesn't make
    > much sense to POST something to a static .html page.
    That's what I told a helper friend of mine, but he told me
    the POST is done
    by the server, not the JS files. That's why, according to
    him, he couldn't
    tell me what code to change in the .js files.
    But here they are, if you would be so kind as to tell me WHAT
    to replace
    with WHAT so the call is made properly. :-)
    http://www.vilverset.com/scripts/control.modal.2.2.3.js
    http://www.vilverset.com/scripts/effects.js
    http://www.vilverset.com/scripts/prototype.js
    Those are the 3 files needed for the script.
    Should I be banging on Dreamhost's door to fix something, or
    not? Because
    the exact same 3 files will render an HTML page just fine
    over on
    roxanacampagiorni.com.
    Which is the guilty party? The script, or the server config?

  • Coded ui scripts working in one system when taken latest it is not working in other system

    Executable scripts working on one system, when taken latest on another system and executed, fails without throwing any error

    Hi Yellesh,
    Could you please provide us detailed error messages so that we can further look at this issue?  This blog introduced a similar scenario, maybe it can help you.
    http://blogs.msdn.com/b/mathew_aniyan/archive/2011/03/01/smart-match-amp-slow-coded-ui-tests.aspx
    One quick way to figure out the issue is to record a new and similar coded UI test against the same application on another system and run it. If the new test run fines, compare it with the old one for example the searchproperties of controls and the control
    hierarchy etc.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Classic - text ringtones work for one contact but not for others

    Just got the new Blackberry classic.  I'm having trouble with the ringtones for the text messages.  The custom ringtone works for one contact but not for the others.  I have taken the same custom ringtone that works for contact A and used it for contact B but it only works for A.  B sounds the default ringtone from the default profile instead of the custom ringtone.
    I have deleted all contacts and done a re-sync thinking something was corrupt.  That didn't work. 
    None of the contacts have a link. 
    I have changed the notification profile and it still doesn't work. 
    I have deleted a contact and recreated it manually.  It still doesn't work. 
    I finally deleted my dad's  contact and from the phone app created a new contact.  I set a custom ringtone for him and it worked.  I of course had to recreate all his other information manually.  Please tell me there is some other way to fix this than recreating manually all 147 contacts in my contact list.
    I read that if the phone number has the hypen or space it won't work, but my dad's contact info that I created from the phone app has the hypen and it rings with the custom ringtone.  Also contact A has no hypen in the phone number and it rings the custom ringtone.  So that didn't seem to matter. 
    I have spent hours on Google and see that lots of people have had this problem (but not everyone) but have not yet found a solution. 
    Surely someone has found a fix for this issue.

    Make sure that the contact has "Mobile" as the field for her number and not "iPhone".
    Note that the iPad cannot send SMS messages.

  • HELP!! WRT54G2 works for one computer, but not for the other

    I have a WRT54G2 and it is connected to 2 computers. The internet works in one computer, but not on the other. The tech support said i needed to configure it or firmware or something like that. But my product is out of warranty and I really need the internet on the other computer as well. Please Help!!!

    As your one computer is working fine then there is no problem with the router so far...
    The computer which is not working...check the IP Address on that...
    Click Start >> All Programs >> Accessories >> Command Prompt...A black box will appear(Command Prompt)...In the Command Prompt window type ipconfig and press 'Enter'...Look for Ethernet Adapter Local Area Connection IP Address , Subnet Mask and Default Gateway...
    IP Address should be 192.168.1.x, Subnet Mask : 255.255.255.0, Default Gateway : 192.168.1.1 (assuming your router is 192.168.1.1)...
    If you get the above mentioned IP Address, Subnet and Gateway Address then you should ping the Gateway, type ping 192.168.1.1 and press Enter...If it gives you request timed out then disable any firewalls, security softwares on the computer...
    If you get 4 replies then type ping 4.2.2.2 and press Enter, if you get request timed out, then you need to upgrade your router's firmware...If you get 4 replies then type ping yahoo.com and press Enter...If you get replies for Yahoo then you should get the Internet after adjusting the browser settings...
    Adjusting Browser Settings : Open an IE, click Tools >> Internet Options, then delete all files, cookies, history, forms...Goto "Connections", make sure Never Dial a Connection is checked, click on LAN Settings and make sure all the options are unchecked...Once you are done click on O.k...Close the IE and re-open it...
    If yahoo times out then provide static DNS on your LAN Connection...
    Click on the Start button >>> Settings >>> Control Panel >>>Network Connections- Right click on the icon for Local Area Connection and go to properties- On the 'General' tab select 'Internet Protocol TCP/IP' and click on the Properties button- Select 'Use the Following DNS Settings' Preferred DNS 4.2.2.2 Alternate DNS - 192.168.1.1>>Click on Ok button to Save and Click on "Close" on main Properties window...You should be able to go online...

  • Playing playlists on apple TV:  It worked at one time, but not now.  Home sharing is on, on the computer, but AppleTV wants me to turn it on!

    Trying to play playlist on Apple TV.  It worked at one time, but not now.  Home sharing is on, on the computer; but apple TV keeps asking me to turn home sharing on.
      What gives?

    Hello hobartco,
    Home sharing will, indeed, need to be set up on your Apple TV, as well.
    Setting up Home Sharing for Apple TV (2nd generation and 3rd generation)
    http://support.apple.com/kb/HT4352
    Cheers,
    Allen

  • Hello All. I am working on a form, but I need to format the leading in a multi-line text-field.

    Hello All. I am working on a form, but I need to format the leading in a multi-line text-field. The options for the text-field only show a font size option, but no other styling options. Is there a way to format the leading? Thanks!

    Not within ID, and I'm not sure it can be done in Acrobat afterward either.

  • I am facing a weird problem with my iphone 4s Wi-Fi connectivity. As i connect my iphone to my office Wi-Fi, internet works in one building, but it doesnt work in the other building, although the phone shows Wi-Fi is connected. Please help me out!!

    I am facing a weird problem with my iphone 4s Wi-Fi connectivity. As i connect my iphone to my office Wi-Fi, internet works in one building, but it doesnt work in the other building, although the phone shows Wi-Fi is connected in the other building. This problem was not there earlier but has occured recently. I would also like to mention that none of my other colleauges who uses iphone are not facing this issue. Please help me out!!

    Assuming you entered the correct WiFi password for your network, see these articles:
    iOS: Troubleshooting Wi-Fi networks and connections
    iOS and OS X: Recommended settings for Wi-Fi routers and access points

  • IPhone 5 wifi works in one room but not the other.

    I have an iPhone 5 and the wifi is unreliable. It works in the room with the router but when I walk down the hall it doesn't work. I'm talking 20 feet away. So frustrating because the phone is almost worthless. Why would it connect but only in such close range? No other devices have this problem. Yes, I've turned the wifi on and off. Yes, I've restarted the router. Yes, I've checked the WEP. It just makes no sense that it would work in one room but not the next room. Help!

    Hello Gnpco,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    Wi-Fi and Bluetooth: Potential sources of wireless interference
    http://support.apple.com/kb/HT1365
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/TS1398
    Be sure you're in range of your Wi-Fi router (access point).
    Tap Settings > Wi-Fi and turn Wi-Fi off and on. If your W-Fi setting is dimmed, follow these steps.
    Restart your iOS device.
    Tap Settings > Wi-Fi and locate the Wi-Fi network to which you're connected.
    Tap and Forget this Network.
    Try to connect to your desired Wi-Fi network.
    Note: You may need to enter your Wi-Fi password again if your network requires one.
    Turn your Wi-Fi router off and on2. If your ISP also provides cable or phone service, check with them before attempting this step to avoid interruption of service.
    Update your device to the latest version of software.
    Update your Wi-Fi router to the latest firmware2. For AirPort Base Stations, install updates using the AirPort Utility.
    Best of luck,
    Mario

  • Implicit read with assembly module instance working on one computer, but not another

    Hi,
    I'm trying to set up an on-site computer to run a VI which uses assembly instances for data communication, but for some reason I'm unable to establish a connection to the PLC.
    I'm running the example vi "CreateAssemblyInstance.vi" to try and get the communication set up before I start using my actual program.
    When I run this code on my development machine, I'm able to establish a connection to the PLC and read data. I then go into RSLogix 5000 and change the IP address to the on-site machine and try to run the test VI there, but I'm unable to make a connection. LabVIEW-side, the program thinks that it's established a connection and is reading/writing data, but PLC-side I'm getting a "Connection Failed" message in RSLogix.
    I find it weird that LabVIEW thinks the connection was established just fine, which the RSLogix says it can't connect to the VI.
    Just wondering if anyone else has had this happen. We aren't sure why the same VI runs on one machine but not another. We used RSLogix to change the IP address of the target machine, so we don't think that's the issue. And both computers are on the same network, so we don't think it's a firewall issue either.
    LabVIEW-side, things should be identical. I'm running the same example VI that came with the Ethernet/IP module. PLC-side, we're changing the target IP of the module within RSLogix 5000 (and we're sending the updated information to the PLC) to match the machine we're trying to make a connection with. Are we missing any steps? This is the first time we've tried using an assembly module, so we're having a hard time troubleshooting.
    Any ideas on why this is happening?

    I'm pretty sure we're using a generic ethernet module:
    I can communicate explicitly with the problem computer, it's able to use 'Tag Read' and 'Tag Write' to communicate with the PLC.
    We started having another problem just recently too. The Tag Read and Write commands are almost always timing out. I keep getting the error message -251723752:
    Detailed error info: Error -251723752 occurred at EthernetIP Tag Read REAL.vi;Details: The request response was not received in the requested timeout period    Possible reason(s):  Ethernet/IP Industrial Protocol: (Hex 0xF0FF0018) The request response was not received in the requested timeout period
    I can't figure out what's causing this all of a sudden, could these issues be related?

Maybe you are looking for