Set time with jscript - InfoPath Dev
in

InfoPath Dev

Set time with jscript

Last post 07-03-2008 06:39 AM by Dromont. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-02-2008 11:54 PM

    Set time with jscript

    Hi!

    I have a question for you. In my form I have a time field (OreTotali) that I would like to fill with jscript code. I set the time that I want to display with this code:

    c.setTime(vsot)
    var h = c.getUTCHours(); var m = c.getUTCMinutes(); if (m<10) { var m = "0"+m; } var oraintervento = h+":"+m var sc87 = nodo.selectSingleNode("my:OreTotali"); if (sc87.getAttribute("xsi:nil")) { sc87.removeAttribute("xsi:nil"); } sc87.text = oraintervento;
    In the field appears the right value but the problem is that around the field there is the red dashed border and so I cant submit the form.
    What I have to do for set the field "OreTotali" by jscript?
    Thank you
     
  • 07-03-2008 02:35 AM In reply to

    • bogdantc
    • Not Ranked
      Male
    • Joined on 05-28-2008
    • Bucharest
    • Posts 25

     check the date format of the field in design and set it to your needs ...

    Able was I ere I saw Elba
  • 07-03-2008 02:54 AM In reply to

    The format date is "9:46". And, as you can see from the code, my string is "h:mm"...

  • 07-03-2008 06:39 AM In reply to

    I find the error:
    without this " if (m<10) { var m = "0"+m; }" it works!!!

    Just another question: Whats happend if I dont  put again the nil attribute? What I have to do for replace it?

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.