Javascript help/question

I have a cf form with <cfinput type=text
name="dateArrived" value="#dateformat(now(), 'mm/dd/yyyy')#"
onBlur="validateForm(initiateForm)">
When the form is first loaded, I display todays date but they
have the option of changing it. The only requirement is that the
date cannot be greater than today.
I call the following javascript function to try and check to
make sure the date entered is not greater than todays date (there
is other javascript code to check for valid date formats, requried
entry etc. :
function validateForm(initiateForm){
var returnStatus = true;
var today = new Date();
if (initiateForm.dateArrived.value > today)
alert("greater datea");
initiateForm.dateArrived.focus();
returnStatus(false);
But I keep getting a object error. I think I have everything
defined but obviously not. What am I doing wrong and do I need this
in its own function ? Seems simple enought but it will not work for
me.

I tried to modify my javascript code to check for the date,
and radio button and checkboxes included, and now nothing is being
called. When I submit, nothing is valideded and the form submits.
What did I do to butcher it ?
<Script language="JavaScript">
function validateForm()
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var todaydate = month + "/" + day + "/" + year
if(document.initiateForm.dateArrived.value > todaysdate)
alert('Date Arrived cannot be greater than today.');
initiateForm.dateArrived.focus();
return(false);
if (document.initiateForm.dateArrived.value == "")
alert("Please enter the date arrived.");
document.initiateForm.dateArrived.focus();
returnStatus(false);
myOption = -1;
for (i=document.initiateForm.siteID.length-1; i > -1;
i--) {
if (document.initiateForm.siteID
.checked) {
myOption = i; i = -1;
if (myOption == -1) {
alert("Please select a site.");
returnStatus(false);
myOption = -1;
for (i=document.initiateForm.errorID.length-1; i > -1;
i--) {
if (document.initiateForm.errorID.checked) {
myOption = i; i = -1;
if (myOption == -1) {
alert("Please select at least one error description.");
returnStatus(false);
if (document.initiateForm.errorID["7"].checked &&
initiateForm.comments.value == "")
alert ("Comments are required.");
document.initiateForm.comments.focus();
returnStatus(false);
if (document.initiateForm.comments.value.length > 400)
alert ("Comments cannot be more than 400 characters.");
document.initiateForm.comments.focus();
returnStatus(false);
return(true);
</Script>

Similar Messages

  • Javascript opoup question?

    My question is
    in window.open() if i give resizable=no and scrollbars=no is working fine in IE but not working in mozilla
    anyone can help?
    Thank You,
    Sreenu.G

    gantinapalli wrote:
    even specifying the width and height also it's not workingYou did something wrong.
    This example works in all browsers here:
    <html>
        <head>
            <title>Test</title>
        </head>
        <body>
            <button onclick="window.open('http://google.com', 'test', 'width=500px, height=300px, resizeable=no, scrollbars=no')">test</button>
        </body>
    </html>And in the future please post Javascript related questions at a Javascript forum. This has nothing to do with JSF. There are JS forums at dynamicdrive.com and webdeveloper.com.

  • InDesign JavaScript "help" file

    I have used Jongware's InDesign JavaScript help files and have really found them essential. I am grateful for his efforts to make these available.
    I am primarily a FrameMaker user and Adobe is going to provide ExtendScript support for the next version of FrameMaker. The FrameMaker object model is shown in the ExtendScript Toolkit CS5 Object Model Viewer. I would like to do something similar to what Jongware did in extracting the data to a series of HTML files. I am having difficulty figuring out where this data is stored. I can't find an XML file that contains the data. I am mainly posting this here because I haven't been able to contact Jongware directly. Thanks in advance for any help.
    Rick

    Oops :-) Yeah to avoid sp@m I don't really want to post my mail addresses on public sites.
    I sent you a P.M., I'm hugely interested in what you are planning!

  • TS1815 Subject: What Mountain Bike help  I can't download my magazine, what mountain bike skills issue. I've followed the advise on the help questions but still can't view the magazine. Delete, re install etc.

    Subject: What Mountain Bike help
    I can't download my magazine, what mountain bike skills issue. I've followed the advise on the help questions but still can't view the magazine. Delete, re install etc.
    Thanks Malcolm

    said article below....
    HT1747: iTunes: How to remove and reinstall the Apple Mobile Device Service on Mac OS X 10.6.8 or Earlier
    Learn about iTunes: How to remove and reinstall the Apple Mobile Device Service on Mac OS X 10.6.8 or Earlier

  • [CS5/JS] Ann: Javascript Help files updated

    Hi everyone. The new user-friendly Javascript Help files have been updated with a CS5 version. Download link on its homepage: http://www.jongware.com/idjshelp.html
    Only in Windows CHM-format for the moment (does anyone at all use the HTML version? If not ... well ... I dunno...).
    I spotted a few additions and changes in the Help file -- apart from support for the new commands, obviously -- such as proper Superclass referencing, and a few objects with Class properties, which apparently are something else than Instance properties. Hey, don't ask me. I only converted the file.
    Among the more interesting new objects:
    * "PlaceGun" -- finally, a way to 'load' the gun with text created solely by scripting?
    * "BeforeCreate", "AfterCreate" (and a few more similar): trap the event for (possibly) every object you can place into ID!
    * A new Scripting Preference: measurementUnit. Apparently, this is "the measurement unit used during script processing" and, ya-hey!, we scripters don't have to awkwardly read, save, change, and restore, the measurement units anymore!

    Minor cosmetic updates to the CHM version:
    * The bullet was shown as a decoded UTF-8 value on Robin Lu's Mac CHM viewer. Changed from its Unicode value to "&bull;" (quite the trick, as Saxon firmly objects to HTML stuff like that!). There may be more 'mangled' characters remaining, dunno if it's worth the trouble hunting them down one by one tho'.
    * Contrary to what I stated before, the Help does contain a few examples -- in the JavaScript Base Classes section. Rather terse, so for the experienced scripter they are hardly relevant; but perhaps newbies can put them to good use. They are marked by a pretty-in-pink background.
    * The list of parents in the Hierarchy view was not sorted alphabetically -- fixed. (I've finally started using XSLT 2.0 functions. Yay!)
    * Lists of multiple object datatypes were not sorted alphabetically -- fixed, by sorting them on the comma and the word "or". However, some of the more incomprehensible descriptions now got just a bit more incomprehensible ...
    E.g., common in "resize" functions: "Can accept: Array of 2 Reals, AnchorPoint enumerator or Array of Arrays of 2 Reals, CoordinateSpaces enumerators, AnchorPoint enumerators, BoundingBoxLimits enumerators or Long Integers." I have no idea how to mentally parse that, let alone have my computer do it.
    * Added more and more hyperlinks. I think most of ScriptUI's internal links to "Button", "Window", etc. which also have a 'regular' UI counterpart finally point to ScriptUI's own objects. Hard to check, really.
    * Also added hyperlinks for the common objects "Boolean", "String", "Number", and "Array" -- just to be complete!
    * The total number of internal hyperlinks now tops out above 104,000! (And no, I didn't check all of them.)
    Direct link to the CHM version: http://www.jongware.com/binaries/idcs5js_chm_3.0.3.zip
    (the minor version number jump from .1 to .3 is because of a lot of testing before I got everything right -- again...)
    The HTML version follows, somehow, somewhere, some time later. (HTML users: is that full function index of any use?)
    * For some reason the page for the "Global classes" was interpreted in the CHM contents as a 'book', rather than a regular help page, and you could not navigate to there! (A search for 'inifinity' still landed you on that page.) Fixed by hand, but I wonder why this happened ...
    Oh darn it! I found out why that happened, re-wrote part of my XSLT transform to fix it and broke lots of other things. Today, I fixed that, and now I see this doesn't work anymore -- again!
    You will be expecting a 0.4 version shortly, then.

  • Map.xml and context-sensitive help question

    We're changing the tools we use to generate JavaHelp from RoboHelp to WebWorks.
    RoboHelp's output always includes a file named map.xml. WebWorks doesn't include this file.
    My understanding is that map.xml is what applications use to find the correct context-sensitive topic. Is that right? Will the app be able to find context-sensitive files without it?
    Stan Stansbury

    There are a couple of posts about masterdata.xml that seem to indicate it's not a problem. See if either of these help.
    Context Sensitive Help Question
    MasterData.xml
    For the 'main portal page' bit - maybe the developer wants to know the Start Page of the project, rather than the Default Topic? I'm not very familiar with CSH and webhelp, so I'm uncertain of the details the developer needs, but I wouldn't think you'd have to change anything as long as they have all the necessary details.
    Amber

  • About use mouse middle key to call JavaScript function question

    I want use mouse middle key to call JavaScript function (<a href="javascript:help()">) help() will open a new Window and direct to my GUI Help Page but when I click it with middle key ,it will open new Tab blank Page that url="javascript:help()"; can not Executive help function... Is this a Firefox Bug or correct behavior in Firefox? thank.

    You need to use a left click to handle JavaScript links.
    See also http://kb.mozillazine.org/browser.link.open_newwindow.restriction

  • Before your Firefox Help question (Why is it that text is transposed over text when viewing certain websites. I'm running win 7 and the latest version of FF.)

    Before your Firefox Help question (Why is it that text is transposed over text when viewing certain websites. I'm running win 7 and the latest version of FF.)

    If you have increased the minimum font size then try the default setting "none" as a (too) high value can cause issues.
    *Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    Make sure that you allow websites to choose their fonts.
    *Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"
    *https://support.mozilla.org/kb/Changing+fonts+and+colors
    It is better not to increase the minimum font size, but use an extension to set the default page zoom to prevent issues with overlapping text.
    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/

  • Javascript Help - Customising buttons to display varied data

    Hi there,
    I'm looking for some Javascripting help since I'm new to this form of scripting. In the report template I'm creating, I need to have a series of radio buttons with each being able to display a different amount of data when selected. So for example, if you choose option a and hit the select button: one layout for the document is shown, option b: another different layout would display, etc.
    Here's a link to an existing pdf which demonstrates what I'm looking for in the second half of the page. The pdf is locked so I can't look at the existing coding or anything that they've used. Any help would be greatly appreciated~ Thanks.
    http://www.lands.nsw.gov.au/_media/lands/pdf/rp_dealings_interactive/01T_v3-2.pdf

    Nariko,
    Place your "different amounts of data" in their own subforms. Have each subform default as hidden so that they won't show. Next in the change event for the radio button group place the following javascript (this assumes your radio button group has it's values bound as 1, 2, & 3):
    if(this.rawValue == 1)
    subForm1.presence = "visible";
    subForm2.presence = "hidden";
    subForm3.presence = "hidden";
    else if(this.rawValue == 2)
    subForm2.presence = "visible";
    subForm1.presence = "hidden";
    subForm3.presence = "hidden";
    else if(this.rawValue == 3)
    subForm3.presence = "visible";
    subForm1.presence = "hidden";
    subForm2.presence = "hidden";
    This will display and hide the objects in the various sub forms based on which radio button is selected.

  • Help question confirmation failing

    I'm trying to confirm re: my firefox help question... The link given me is
    https://support.mozilla.com/en-US/users/activate/e4259040a179f9f3eb2904a5673a8309b88e860c
    and I'm getting "something is wrong" messages.

    Your previous question is here.
    https://support.mozilla.com/en-US/questions/848877

  • Javascript/HTML question

    I've been teaching myself Java on and off for the past couple years with the help of these forums and other tutorials. Now I've decided to take on a project that requires the use of HTML and Javascript and I can't seem to find the information I need. I was hoping that somebody from these forums could either answer my questions and/or point me in the right direction to find the answers.
    The project is simple. I created an HTML window with an inputTextArea, an outputTextArea, and two buttons (Submit and Reset). When Submit is pressed I need the program to take the text from inputTextArea one line at a time, check the indexOf a string, and add tags at the beginning and end of the string if it meets certain criteria before appending it to outputTextArea.
    I can (and have) written this very easily in Java but I can't seem to find the methods I need in Javascript. In java I use a java.io LineReader to read the inputTextArea.getText() one line at a time and then make the changes as needed. I actually can't even find a tutorial in Javascript that can explain how to take the text from inputTextArea and print it into outputTextArea.
    So the main thing I need to know is how to read one line of text at a time from the inputTextArea. I think I can figure the rest out.

    That was actually my original thought when I started on the Java version of the program but I couldn't figure out how to enter the the carriage return in as a variable to be indexed. So it wasn't until after I found the LineReader that I was able to complete the Java version.
    Is there some way to enter the carriage return in as a searchable variable?

  • Set text of container - javascript help, please!

    I have used Dreamweaver behaviours to "Set text of container" and make different writing appear inside a box when I click a hotspot. Now I want people to be able to click on the writing that just appeared and make more text appear in another box. Could someone tell me how to do this? I don't think I can use Dreamweaver's behaviours for this because there's no material trigger... in that the writing that is the trigger only appears when the first trigger is clicked, but I'm more than happy to be corrected!!
    So, I've been trawling through javascript libraries but I don't know what I'm doing, so if someone could either tell me how to do this in dreamweaver or really spell out what libraries etc. I need to download and what code I need to make a bit of text that's already a set text of a container into a trigger for a set text of another container, that would be great!
    Sorry for the complicated question, it's difficult to explain what I mean.
    All help very much appreciated ^^

    flozzle19262010 wrote:
    I... really don't see how that will help you, considering I'm just asking HOW to do something. It's not like there's a mistake in my CSS or whatever, I just want to know if such a thing as described above is possible...
    As I say, I'm reluctant to upload it as it's for someone else.
    Have a look here http://forums.adobe.com/message/2691056#2691056.
    Both Nancy (one of the best in the business) and I have been trying to help. It's your call.
    I wish you the best of luck.
    Ben

  • Iframe redirect javascript help please

    Hi:
    My client uses a loan application on another service's site, and I embedded the form in an iFrame to keep the user on my client's site.
    At the Submit of the form, it redirects to the client's home page, but it does it within the confines of the frame -- I want the redirect to go to the "top" Home page.  Unfortunately, the offsite service cannot apply a target="_top" to the redirect link script.
    The link is http://sequoiapacificmortgage.com/loan-application/
    The service said this:
    "The thank you page after the application and before the redirect URL has a unique URL.
    Is it possible to code your iframe to recognize this URL and redirect the full site to your home page rather than depending on the vLender redirect within the iframe?
    I am including the unique thank you page URL from Lori's website below, the ref_ID attribute is the unique application ID number assigned to my test application (the application ID's are generated using the first 3 letters of the applicant's first name [LYN for Lynsee] and the first 3 letters of the applicant's last name [TES for Testing] followed by the numeric sequence) but you should be able to remove that and have your custom site's code recognize the .php url which would trigger a redirect within your site's code that would take place before our system enacts its redirect to the home page within the iframe.
    (https://www.vlender.com/apps/templates/new_thank_you.php?ref_id=LYNTES998262971)"
    I have seen several references to Javascript to accomplish the desired redirect, but I am not sure how to construct it, nor if it can capture the presence of the mentioned URL to trigger it.
    Can anyone help please?  Thanks much!
    Rgds, Ned

    You are talking about JavaScript - Java and JavaScript are two completely different things. Therefore, this is not the correct area to post that question.

  • Custom JavaScript Help

    I have 5 combo boxes with choices of Y, N and NA. When yes is selected the score will equal 3, when no is selected the score will equal 0, when NA is selected the score will show no score. I have a text box that will then show the final score from the 5 combo boxes, out of a possible 15. I have one last text field that will show a pass or fail. A pass would be 15 anything less than a 15 is a fail. I have custom JavaScript stating the following:
    var aFields = new Array("6 Combo Box 1", "6 Combo Box 2", "6 Combo Box 3", "6 Combo Box 4", "6 Combo Box 5");
    var aDefault = new Array();
    for (var i = 0; i < aFields.length; i++){
         if (this.getField(aFields[i]).value == this.getField(aFields[i]).defaultValue){  //compares field value to default value which is empty
              aDefault.push(aFields[i]);  //this will create an array of fields not filled in
    var v = +this.getField("Model Call Score").value;
    if (v>14) event.value = "Pass";
    else event.value = "Fail";
    //verify if aDefault contains at least one field
    if (aDefault.length >0){
         event.target.display = display.hidden; 
    //hide my value if a field is still empty
    else{
         event.target.display = display.visible;
    I understand that the last part of the code said to make the value hidden. I want a pass or a fail to show up only when all combo boxes are selected. I do not have knowledge of JavaScript. Could someone please help me correct my current code or come up with another suggestion. Attached is a link to my form. My above question is referring to the bottom section.

    Wicked! Thanks so much! I have one last question regarding this form. Earlier in my form I have 5 sections of combo boxes. Each section contains 4 choices. They then populate a score then an average score then a final average score. The issue I'm having is if the user selects NA it no longer counts in the score, the score would now be based out of 3 and not 4. If they select NA twice the score would be based out of 2 and not 4. How can I write a custom JavaScript that lets me say what the score will be based on if the user selects NA.

  • Math.min JavaScript help needed

    Hello,
    I am trying to write a script for a fillable PDF in Adobe Acrobat, but I don't have much experience with JavaScript and I need some help!
    Basically I have three fields as follows:
    A1 = a field with a number value in it
    B1 = a field with a number value in it
    C1 = a field where the sum calculation will be.
    I want to write a script that will enter the lesser of the values in A1 and B1 into C1. If no value has been entered into B1, then it enters the value of A1 into C1.
    This is what I have come up with so far:
        // Get the field values, number fields as numbers
        var d1 = getField("A1").value;
        var d2 = +getField("B1").value;
        // Set the field value to either A1 or B1, whichever is lesser
         event.value = Math.min(d1,d2);
    Some of the problems with the script so far are:
    It does not calculate correctly if there is no value entered in B1 (should give just A1).
    It doesn't update the event.value if A1 is changed (until another form field is modified)
    Can anyone help??
    Thanks!

    Adjusted the field calculation order fixed question 2.
    The script given as answer worked great except for one area.
    B1 values can range from 0 and up. If a 0 is entered in B1, then the Math.min ignores it since d2=="".
    I can get around that problem by having a default value set in B1 of -1 (outside of the range). I'd prefer that there not be a default value set.
    Any suggestions? I appreciate the help.

Maybe you are looking for

  • Sale Order Status Report

    Dear Expert. I want Sales Order Status report as below mentioned format required quarry base report from Date to To Date. Location-OrderSeries-OrderNo-CardCode-CardName-ItemCode-Item Descripotion-Inv.UOM-Order Qty-Allocated Qty-DeliverQty-Peniding Qt

  • RE: issue with sample watermark apperaring in purchase order

    Hi Team, our client is facing an issue when Purchase order is got created from production and when it is released an email notification is been send to vendor and today in the purchase order sample watermark is appearing in the background when i cros

  • To display a new bold line in script header.

    I have header part in my script which contians LOGO. Below the logo, I need to display a bold line say ' <b>International cutter'</b> as centered one. Could you please say me how can I achieve this ? Do I need to create a character for this ??? Thank

  • Where are files stored?

    In the midst of recovering from a hard drive failure, the one thing I can't figure out is where the documents for my iWeb site (backups on my iDisk: web.sites.iweb.site) should be placed on my hard drive in order to be accessed by iWeb when I launch

  • SQL query with PHP variable help

    Hi, Using Dreamweaver Developer Toolbox, I added a Horizontal recordset to get two columns across for the city. Next to this is a number value of how many records are in the particular city. But I have gone wrong somewhere, as I get the same value fo