Handling form dates

Hi there,
I have a straight forward form in that requires the user to enter a date in one box and then a script automatically fills in a second box with an new date 10 day further on.
The script I'm using is
var strStart = this.getField("DateStart1").value;
if(strStart.length)
  var dateStart = util.scand("d-mmm-yyyy",strStart);
  var oneDay = 24 * 60 * 60 * 1000;
  var dueMillis = dateStart.getTime() + 5 * oneDay;
  var dueDate = new Date(dueMillis);
  event.value = util.printd("d-mmm-yyyy",dueDate);
else
  event.value = "NA";
the problem i have is that when the user fills in any of the other boxes on the form prior to the date (which given the flow of the layout is a sensible the natural thing to do) the get the following warning.
Now the two form fields involvedd in the script have their format to d-mmm-yyy, so any ideas (other than having the user always fill in the date box first) as to how I prevent this box from showing up.
thanks in advance for any help.

"NA" is not a valid date. You should set your field to have no formatting.
Then you should not receive this error.

Similar Messages

  • Handling form data

    Hi all,
    i will first xplain the situation:
    i have page1 which sends 3 form data like year , date , name
    to page2 , in page2 im getting the form date(from page1) and store
    that data in new variables, In page 2 i have a form there i am
    using three hidden fileds for passing the data from the previous
    page(page1) to the same page because my query changes with the url
    data.Iam getting an error saying month2 is not defined in form, can
    anyone help me out, i appreciate any new ideas.
    Thanks in advance
    here is the code :
    <cfquery name="getWinners1" datasource="FMA_REPORTS" >
    select convert(char,f.monthYear,101)as date
    , r.run_start_date as date ,r.run_name as runname,w.fir_name
    as first,w.last_name as last from fm_run r, wdl_empl w,
    fm_eng_winners f
    where 0=0 and f.empl_id=w.empl_id and r.run_id=f.run_id
    <cfif #runname1# is not " ">
    and r.run_name_ecount= '#runname1#'
    </cfif>
    <cfif #year1# is not "00">
    and datepart(yyyy,f.monthYear)=#year1# </cfif>
    <cfif #month1# is not "00">
    and datepart(mm,f.monthYear)=#month1#</cfif>
    <cfif #orderby1# is not "" >
    and order by #orderby1#</cfif>
    </cfquery>
    the runname , year1, month1 are from page1(i used cfset
    month1=#form.month#>)
    My form:
    <cfform name="Rankings" action="new_ra.cfm" method="post"
    preservedata="no">
    <input type="hidden" value="#runname1#"
    name="runname2">
    <input type="hidden" value="#year1#" name="year2">
    <input type="hidden" value="#month1#" name="month2">
    <cfoutput>
    checking the input fields: value="#runname1#"
    </cfoutput>
    <cfif #getWinners1.RecordCount# NOT EQUAL 0 >
    <table border="=1">
    <tr><td><a href="new_ra.cfm?orderby=run_name"
    onClick="javascript: submitform()">RUN
    NAME</a></td><td><a
    href="new_ra.cfm?orderby=first" onClick="javascript:
    submitform()">FIRST NAME</a></td><td><a
    href="new_ra.cfm?orderby=last" onClick="javascript:
    submitform()"></a> LAST NAME</td><td
    colspan="2"><a
    href="new_ra.cfm?orderby=date">DATE</a></tr>
    <cfoutput query=getWinners1>
    <tr><td>#runname#</td><td>#first#</td><td>#last#</td><td>#date#</td></tr>
    </cfoutput>
    </table>
    </cfform>
    Error message:
    Element MONTH2 is undefined in FORM.
    The error occurred in
    /content/employees/htdocs/emp/operating/tey/fuel_masters/reporting/new_ra.cfm:
    line 3
    1 : <cfif Isdefined("URL.orderby")>
    2 : <cfoutput>
    3 :
    Text
    form month2 value="#Form.month2#"
    4 : form year value= #form.year2#
    5 : orderby =#URL.orderby#</cfoutput>

    It is difficult if not impossible to have url and form
    variables in the same template. It sounds like your page 2 form is
    using method="get". If that's the case, change your scope to url
    for all those form variables.

  • Create text file from form data

    I need to create a form using dreamweaver and coldfusion. We
    do not have coldfusion server. just Dreamweaver 8. Until we decide
    what application server we will use, I need to create a text file
    each time a user submits data from a form and put the data into a
    text file. What would be the best way to handle this?

    if you do not have an application server like CF or PHP or
    ASP (or
    other) to process your form submissions, you should look for
    a perl/cgi
    script that can do it for you. i remember from awhile ago a
    script
    called bnbform from bignosebird.com ... it is used for
    emailing form
    submissions to a designated email address, but if i remember
    correctly
    it also stored form data in a text file....
    Azadi

  • Having garbage characters while using enctype="multipart/form-data"

    Hi to all! =)
    I'm uploading a CSV file in JSP ny adding [enctype="multipart/form-data"].
    <html:form method="POST" action="/upload.do" enctype="multipart/form-data">Now, I have a problem on handling Japanese Characters. (becomes garbage)
    I have declared a UTF-8 charset above my JSP
    [<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="Shift_JIS" %>]Using
    System.out.println(response.getCharacterEncoding());in my action, I get "ISO-8859-1" instead of UTF-8
    I don't have any clue why this has happened. Can someone teach me how to override the "ISO-8859-1" coding.
    Any suggestions will be deeply appreciated.

    Hi to all! =)
    I'm uploading a CSV file in JSP ny adding [enctype="multipart/form-data"].
    <html:form method="POST" action="/upload.do" enctype="multipart/form-data">Now, I have a problem on handling Japanese Characters. (becomes garbage)
    I have declared a UTF-8 charset above my JSP
    [<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="Shift_JIS" %>]Using
    System.out.println(response.getCharacterEncoding());in my action, I get "ISO-8859-1" instead of UTF-8
    I don't have any clue why this has happened. Can someone teach me how to override the "ISO-8859-1" coding.
    Any suggestions will be deeply appreciated.

  • How do i get rid of the confirmation popup that says This web page is being redirected to a new location. Would you like to resend the form data you have typed

    when navigating on certain sites (fiverr.com is one), i get the popup confirmation "This web page is being redirected to a new location. Would you like to resend the form data you have typed to the new location?"
    this is highly annoying and i can't find a way to turn this annoyance off. help!

    because of its impact on security this error message cannot be suppressed. you might want to contact the admins of the website where this is occuring and ask them to implement a handling of user input without sending it to a different server...

  • Extension type for mime-type "multipart/form-data"

              Hello:
              If I want to register a mime-type of type "multipart/form-data" in WebLogic 6.0
              what, if any, extension should I specify fot it in the web.xml? Is it necessary
              to specify this mime-type for handling "multipart/form-data" type http requests?
              Thanks
              John
              

    You cannot use request.getParameter() for Multipart/form-data.
              You need to Use getInputStream and use the InputStream to read data.
              Please Refer Jeason Hunters Implementation for the same. Its a very good example.
              Kumar.
              John Buckley wrote:
              > Hmm. Strange. When I send in a multipart/form-data request and when I try to do
              > a request.getParameter within my servlet it returns null and also throws a socket
              > exception at the server console.
              >
              > Any ideas?
              >
              > John
              >
              > Mettu Kumar <[email protected]> wrote:
              > >I don't think its neccesary as I am able to run my code with wls6.0 without
              > >registering
              > >multipart/form-data.
              > >
              > >kumar.
              > >John Buckley wrote:
              > >
              > >> Hello:
              > >> If I want to register a mime-type of type "multipart/form-data" in
              > >WebLogic 6.0
              > >> what, if any, extension should I specify fot it in the web.xml? Is
              > >it necessary
              > >> to specify this mime-type for handling "multipart/form-data" type http
              > >requests?
              > >>
              > >> Thanks
              > >>
              > >> John
              > >
              

  • Best practice: Saving form data

    Hello,
    I'm new to the JSP technology.
    To get some experience I built my own little shoutbox "application" where you can insert your name and a message and if you click on "submit" your message appears at the top of the page. Older messages also appear below the new message.
    For this, I created a little JavaBean which handles the entered name and the message. I called this class "Message".
    To read the messages out of the database I created another class (MessageHandler) which returns an ArrayList of objects from the Message class.
    I don't know if I'm doing this the right way, but I use this MessageHandler as a JavaBean so that I can do this:
    <jsp:useBean id="handler" scope="session" class="net.stiefels.myshoutbox.MessageHandler"/>
    <jsp:setProperty name="handler" property="limitMessages" value="2"/>
    <c:forEach items="${handler.messages}" var="msg">
         ${msg.text}<br/>
    </c:forEach>The next step is, "how to save new data?".
    With my current experience in JSP I found this possibility:
    Save the form data in a "Message"-Bean and use a MessageHandler method (e.g. setNewMessage) to save the data in the database. The code would then look like this:
    <jsp:useBean class="net.stiefels.myshoutbox.MessageHandler" id="handler" scope="session"/>
    <jsp:useBean class="net.stiefels.myshoutbox.Message" id="newMessage" scope="page"/>
    <jsp:setProperty name="newMessage" property="*"/>  // save form data
    <jsp:setProperty name="handler" property="newMessage" value="${newMessage}"/>  // save Message-Bean in databaseMy question now is if this way is the normal procedure to save form input in a database?
    If not, which way would be a better one?
    Thanks a lot!
    Simon

    I never use that approach
    Simple pages
    When I submit I have a servlet or Struts action that does the insert and then redirects/forwards to the submitting JSP , this JSP will then requery DB.
    More complex
    Always start with Struts and store all information on the Struts actionform.

  • How to handle The Date error???

    Actually I am using three dropdown list as day,month and year
    day contains 31 items and same values i.e., 1,2,3...31
    and month contains jan,feb,....dec
    year 1981,1982,.....2007
    and I am concateded these three to form date as
    d:=:day||'-'||:month||'-'||:year;
    Now my problem is
    when i am selecting values 31 jun 1980,30 feb 1980 i.e., non existing dates then it is throwing
    "Unhandled trigger ..... "
    please tell me how to handle it?

    There are a number of different exceptions you can get with dates.
    SELECT To_Date('10132007','DDMMYYYY') FROM dual;
    ORA-01843: not a valid month
    SELECT To_Date('99122007','DDMMYYYY') FROM dual;
    ORA-01847: day of month must be between 1 and last day of month
    SELECT To_Date('10-FEB-2007','DDMMYYYY') FROM dual;
    ORA-01858: a non-numeric character was found where a numeric was expectedFor this I would just trap the ORA-01847 and 'when others' exceptions.

  • Can express vi handle large data

    Hello,
    I'm facing problem in handling large data using express vi's. The input to express vi is a large data of 2M samples waveform & i am using 4 such express vi's each with 2M samples connected in parallel. To process these data the express vi's are taking too much of time compared to other general vi's or subvi's. Can anybody give the reason why its taking too much time in processing. As per my understanding since displaying large data in labview is not efficient & since the express vi's have an internal display in the form of configure dialog box. Hence i feel most of the processing time is taken to plot the data on the graph of configure dailog box. If this is correct then Is there any solution to overcome this.
    waiting for reply
    Thanks in advance

    Hi sayaf,
    I don't understand your reasoning for not using the "Open Front Panel"
    option to convert the Express VI to a standard VI. When converting the
    Express VI to a VI, you can save it with a new name and still use the
    Express VI in the same VI.
    By the way, have you heard about the NI LabVIEW Express VI Development Toolkit? That is the choice if you want to be able to create your own Express VIs.
    NB: Not all Express VIs can be edited with the toolkit - you should mainly use the toolkit to develop your own Express VIs.
    Have fun!
    - Philip Courtois, Thinkbot Solutions

  • Copying Appraisal Form data from Old to New..

    Hi,
    My client has been using an Appraisal template since last year and all the users keyed in their data already.Then they wanted some minor changes in the existing Appraisal form.We have created a New Template.
    Now my Client wants to Copy all the old forms data to New Form.They are not interested to ask the users again to Key in all the data.Then want to copy the old form data to new.Is it possible to copy the Old Form data into NewForm ?
    Is there any std way to download & the upload the records?
    I tried to Record(SHDB) the App_create Trnx,But it's not recording the Textarea Subscreens.
    Im using SAP4.7 and HR Extension 2.00 and using HAP_DOCUMENT BSP Application in my Portal.
    Rgds,
    Jothi.P

    my complaining has nothing to do with you disturbing. I think its the heat in India, still not used to it
    In later releases it will be the same. Our design is just this way. You can't copy appraisals, and you can't change released templates. Those are conciously made design decisions which I still stand to.
    From a business point of view it just needs a different approach. Your current situation is not an exception. Here is how I have seen other multinational companies with a global roll-out handle it.
    They setup the appraisal process for a year, say for 2005. They start gathering the suggestions/complaints from employees/management and start discussing internally on the possible changes in the process. Then they implement a new template and make this available for the new round in 2006. The old template they put in "in history".
    So, they stick to the process they have initiated and start with an approved template with the new round. This then does not disrupt the current process, avoids "bad" quick fixes and gives HR the time to test the new process.
    For now, try to create the "copy" report but I would also inform the client that the above process would be the better one on the long run.
    Also from an employee and manager point of view it makes more sense as the process they started doesn't change without them knowing what or why.
    Regards and Groetjes,
    Maurice

  • Send form data from Coldfusion to ASP

    I need to send form data from CF to ASP.
    I submit a CF page and validate it on my end with another CF
    page, which then needs to post the results to an asp page on
    another site. The post has to be sent via SSL and I don't need to
    and cannot receive any status message back from the remote ASP
    site. Any suggestions would be greatly appreciated. I was thinking
    some type of cfhttp, but I am not very familiar with its usage.
    Thanks!

    It doesn't matter what type of page you are sending to as
    long as it can handle the data that is sent. Either a form or
    cfhttp will work.

  • How can I submit form data to an outside url after a purchase?

    I'm using BC as the ecommerce portion of a site that sells certificates that people will purchase.  There is an outside developer creating PDF certificates with their info and a custom code.  Does anyone know how I can submit data from purchase form to an external url?

    Two ways.
    To get around cross site restrictions:
    - In javascript dynamically create a hidden iframe, copy the form data into that iframe, attach an onload event to that iframe, submit the form (in the iframe), once the iframe as loaded, submit the BC form as usual. Google around there should be examples out there.
    - Use JSONP to do the same thing, but this will use a GET so your data wont be encrypted at all (this might not be a concern for you and you'll need to check if the outside developer making the PDF can handle this response).

  • Enable Reader users to save form data

    This question was posted in response to the following article: http://help.adobe.com/en_US/acrobat/standard/using/WS58a04a822e3e50102bd615109794195ff-7e0 d.w.html

    Unless the PDF has extended rights applied, users with Adobe Reader X and earlier on a desktop will not be able to save a copy once they've filled in the form fields - and if you apply those rights you will be bound by the 500-response limit in the EULA.
    You have three options:
    Reader-extend the form using Adobe's enterprise-class LiveCycle ES products, which have no limits on responses but which cost a lot of money.
    Use the FDF/XFDF submission route mentioned by Bill - the form would not be Reader-extended and would not be saveable, but the server script can either email the user their data or redirect them to a dynamically-generated version of the same PDF with their information pre-filled. You can create the form in Acrobat but will need server-side programming to handle the data, e.g. via PHP or ASP.
    Use a hosted non-PDF system for the form, such as the Plus subscription at Adobe FormsCentral. or create the form directly on your website in HTML (as you would with a contact form). Since you're putting the forms online, switching to an online or cloud-based system wouldn't change the experience for your users but you can get more than 500 responses without the huge price tag of LiveCycle.
    Although PDF forms have a lot of benefits, it's important to remember that if all your users are online anyway, there's no reason why you can't do the same thing in HTML. If you're dealing with confidential information it's actually much simpler to use an HTML webform on an SSL server, as the data is only ever passed between the webserver and the user in encrypted format - there's no risk of someone leaving a copy of a filled-in PDF on a public computer, or an email going astray. It's how FormsCentral works.

  • Email form data from within Flash

    Hi all,
    I have searched the Interent and written to several forums
    asking this same question however no one either seems to know the
    answer or just does not want to advise me in any way. I have
    however had a few responses however none of them paid off.
    My Question:
    I am in the process of creating a flash website and I am on
    the last little function I wish to provide. I want to create a
    flash contact us form as some people might not have an email client
    set up therefore I don't want to just but a mailto URL in.
    I have built the form and named the input text boxes, and
    believe I have most of the action script complete. I need to know
    how to use Coldfusion to validate the flash form and then send the
    email with the form data in it. As far as I can understand in flash
    I create a LoadVars method which puts all the form data in this and
    when the user click the submit button flash should send the
    loadvars to a CFC or simliar page. This coldfusion page
    (server-side) handles the processing , i.e. validation reports back
    if need be or continues to send the information to a predefined
    email address i.e. [email protected]
    Can some one please help either point me in a direction of a
    tutorial(s) or provide me with an example of what I am trying to
    do. I am currently running Flash 8 and Coldfusion 8 not sure if
    this has any bearing on what I am trying to do. I am not sure if I
    require Flash Remoting or not, however I do remember reading (not
    sure if this is correct) Coldfusion has Flash Remoting integrated.
    I appreciate any help, support or advise anyone can offer on
    this issue. I am keen to get this moving as my project end date is
    fast approaching.

    Hi,
    For sending email there is no need to use remoting...
    please see this link...
    =>
    http://www.sephiroth.it/tutorials/flashPHP/email/
    and if u not able to do it then i'll do it for you... with
    nominal charge of 20$.
    Thanks,
    Ankur Patel.

  • Capturing Form Data

    I am very new to Macromedia Coldfusion, I have a user
    registration form and would like to capture / store & for
    debugging purposes echo (print) the form data using a CFscript. The
    form’s name is Registration one of the text fields name is
    FirstName. I am having a problem referencing the value entered into
    the field. My reference is as follows …….
    Registration.FirstName but it isn’t recognized what is the
    correct way to reference form data. Does anyone have a colfusion
    script to capture, store and print form data and a query to store
    it in MySql

    My advise is to buy the ColdFusionMX7 Web Application
    Construction Kit. This will answer all of your questions and
    provide you with a solid understanding of ColdFusion basics to
    include: form handling and database interaction..
    http://www.amazon.com/Macromedia-ColdFusion-Web-Application-Construction/dp/0321223675/ref =sr_11_1/105-7037147-7486858?ie=UTF8&qid=1187788238&sr=11-1

Maybe you are looking for

  • 0 byte txt file using receiver File Adapter

    HI, My scenario is Flat File to Fixed Length File. Mapping : Based on the condition Reciever node need to generated , In some cases it wont generate any node ( No data ) Receiver Communication channel :  I used FCC for Fixed length Format. Problem :

  • Help for a Beginner's Program

    Hello, I'm fairly new to the Java language. Recently I was writing a program revolving around the creation of classes and constructors...my code looks like this: import java.util.Scanner; class Money{      private static int dollars, cents;      Mone

  • Hd video to AVI

    Is there a way to compress HD video in Final Cut Pro to AVI? It does not appear in any of my presets or in Compressor. Is there a plug-in I can purchase?

  • SAP Scheduler. Multiple jobs for one job definition issue.

    Hi. I am facing one problem concerning scheduling jobs. I've created a job definition and deployed it on server. In onJob(...) method system queries to DB for a single result, when this result matches some conditions job is finished, otherwise it wai

  • How to Configure the Weblogic Server 6.0 Beta version with Solaris 8

    Hello, I have problem in starting the weblogic server 6.0 beta version. It is occupying hell of space and running very slow. When I try to deploy the bean it is throwing exception like timeout. Plese do suggest me what to do. and how to configure pro