facebook

MyEclipse doesn’t seem to be validating Javascript

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #269727 Reply

    Cytyc
    Member

    Hello,

    I followed your tutorial on validating and debugging Javascript and it doesn’t seem to be working. Validation of Javascript IS enabled and has been from the beginning however some errors in my Javascript (e.g and extra ‘)’) were not caught upon typing, at save, nor when running a validation as your tutorial indicated. My setup info is included below.

    Thanks!
    Cytyc

    *** Date:
    Thursday, May 3, 2007 2:57:55 PM EDT

    ** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.4.2

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 5.1.1 GA
    Build id: 20070302-5.1.1-GA

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 5.1.1 GA
    Build id: 20070302-5.1.1-GA

    Eclipse Platform

    Version: 3.2.2.r322_v20070119-RQghndJN8IM0MsK
    Build id: M20070212-1330

    Eclipse RCP

    Version: 3.2.2.r322_v20070104-8pcviKVqd8J7C1U
    Build id: M20070212-1330

    Eclipse Java Development Tools

    Version: 3.2.2.r322_v20070104-R4CR0Znkvtfjv9-
    Build id: M20070212-1330

    Eclipse Plug-in Development Environment

    Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
    Build id: M20070212-1330

    Eclipse Project SDK

    Version: 3.2.2.r322_v20070104-dCGKm0Ln38lm-8s
    Build id: M20070212-1330

    Eclipse Graphical Editing Framework

    Version: 3.2.2.v20070208
    Build id: 20070208-1315

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    e5c_74
    -product
    com.genuitec.myeclipse.product.ide
    -vm
    C:\WINDOWS\system32\javaw.exe

    #269752

    Riyad Kalla
    Member

    Please provide an example of file contents that we can test on our end, and point out the error it should be catching. Sometimes these can be a case of misunderstanding a spec, and other times it could be a missing case from our validator not catching the isue.

    #269897

    Cytyc
    Member

    Hi there, below is a segment of a script we’re using in a form. If you add an extra ‘)’ to an if statement, or add an extra ‘}’ anywhere in the script, validation does not pick it up. This is pretty straightforward test and I would think these types of errors would be caught eventhough I’m not familiar with your spec for validation.

    Thanks,
    Cytyc

    <SCRIPT LANGUAGE=”JavaScript”>
    function markDirty()
    {
    }

    function clearFields()
    {
    document.myForm._1_1_27_1.value = “”;
    document.myForm._1_1_28_1.value = “”;
    document.myForm._1_1_29_1.value = “”;
    document.myForm._1_1_26_1.value = “”;
    //document.myForm._1_1_35_1.value = “”; BLACKBERRY/PDA DROP DOWN
    document.myForm._1_1_38_1.value = “”;
    document.myForm._1_1_62_1.value = “”;
    document.myForm._1_1_63_1.value = “”;
    }

    function resetFields()
    {
    document.myForm._1_1_2_1.className=’normalField’;
    document.myForm._1_1_11_1.className=’normalField’;
    document.myForm._1_1_13_1.className=’normalField’;
    document.myForm._1_1_16_1.className=’normalField’;
    document.myForm._1_1_22_1.className=’normalField’;
    document.myForm._1_1_45_1.className=’normalField’;
    document.myForm._1_1_53_1.className=’normalField’;
    document.myForm._1_1_54_1.className=’normalField’;
    document.myForm._1_1_39_1.className=’normalField’;
    document.myForm._1_1_62_1.className=’normalField’;
    document.myForm._1_1_63_1.className=’normalField’;
    }

    function validation()
    {
    var validate = 1;
    var alert_msg = “”;

    //resetFields();

    // Requisition Number
    if (myForm._1_1_2_1.value==””)
    {
    alert (“Please enter the Requisition Number”);
    document.myForm._1_1_2_1.className=’errorField’;
    document.myForm._1_1_2_1.focus();
    validate = 0;
    }

    // Action Required
    if (myForm._1_1_22_1.options[myForm._1_1_22_1.selectedIndex].text=='<None>’)
    {
    alert (“Please select the Action Required”);
    document.myForm._1_1_22_1.className=’errorField’;
    document.myForm._1_1_22_1.focus();
    validate = 0;
    }

    // Job Title
    if (myForm._1_1_11_1.value==””)
    {
    alert (“Please enter the Job Title”);
    document.myForm._1_1_11_1.className=’errorField’;
    document.myForm._1_1_11_1.focus();
    validate = 0;
    }

    // Manager Name
    if (myForm._1_1_16_1.value==””)
    {
    alert (“Please enter the Manager Name”);
    document.myForm._1_1_16_1.className=’errorField’;
    document.myForm._1_1_16_1.focus();
    validate = 0;
    }

    // Manager E-mail
    if (myForm._1_1_13_1.value==””)
    {
    alert (“Please enter the Manager E-mail”);
    document.myForm._1_1_13_1.className=’errorField’;
    document.myForm._1_1_13_1.focus();
    validate = 0;
    }

    // Business Entity
    if (myForm._1_1_45_1.options[myForm._1_1_45_1.selectedIndex].text=='<None>’)
    {
    alert (“Please select a Business Entity”);
    document.myForm._1_1_45_1.className=’errorField’;
    document.myForm._1_1_45_1.focus();
    validate = 0;
    }

    // Business Unit
    if (myForm._1_1_53_1.options[myForm._1_1_53_1.selectedIndex].text=='<None>’)
    {
    alert (“Please select a Business Unit”);
    document.myForm._1_1_53_1.className=’errorField’;
    document.myForm._1_1_53_1.focus();
    validate = 0;
    }

    // Geography
    if (myForm._1_1_54_1.options[myForm._1_1_54_1.selectedIndex].text=='<None>’)
    {
    alert (“Please select a Geography”);
    document.myForm._1_1_54_1.className=’errorField’;
    document.myForm._1_1_54_1.focus();
    validate = 0;
    }
    // Position_Territory
    if (myForm._1_1_62_1.value==””)
    {
    alert (“Please enter a Position_Territory Name, or enter NA for a non-field newhire”);
    document.myForm._1_1_62_1.className=’errorField’;
    document.myForm._1_1_62_1.focus();
    validate = 0;
    }
    // TimeZone
    if (myForm._1_1_63_1.options[myForm._1_1_63_1.selectedIndex].text=='<None>’)
    {
    alert (“Please select a TimeZone”);
    document.myForm._1_1_63_1.className=’errorField’;
    document.myForm._1_1_63_1.focus();
    validate = 0;
    }

    // VP E-mail address
    if ((myForm._1_1_38_1.options[myForm._1_1_38_1.selectedIndex].text==’Yes’) && (myForm._1_1_39_1.value==””))
    {
    alert (“Please enter the VP E-mail address”);
    document.myForm._1_1_39_1.className=’errorField’;
    document.myForm._1_1_39_1.focus();
    validate = 0;
    }

    if (validate == 1) {document.myForm.submit();}
    }
    </script>

    #269909

    Riyad Kalla
    Member

    Cytyc,
    Thank you, I’ll file it and have someone look at it. Just to clarify this is inside a HTML/JSP page right?

    #270250

    Cytyc
    Member

    hello, yes, this is within a script section of an html page.

    -Cytyc

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: MyEclipse doesn’t seem to be validating Javascript

You must be logged in to post in the forum log in