For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 4 replies, 2 voices, and was last updated 18 years, 10 months ago by
Cytyc.
-
AuthorPosts
-
CytycMemberHello,
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 WorkbenchVersion: 5.1.1 GA
Build id: 20070302-5.1.1-GAEclipse Platform
Version: 3.2.2.r322_v20070119-RQghndJN8IM0MsK
Build id: M20070212-1330Eclipse RCP
Version: 3.2.2.r322_v20070104-8pcviKVqd8J7C1U
Build id: M20070212-1330Eclipse Java Development Tools
Version: 3.2.2.r322_v20070104-R4CR0Znkvtfjv9-
Build id: M20070212-1330Eclipse Plug-in Development Environment
Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
Build id: M20070212-1330Eclipse Project SDK
Version: 3.2.2.r322_v20070104-dCGKm0Ln38lm-8s
Build id: M20070212-1330Eclipse Graphical Editing Framework
Version: 3.2.2.v20070208
Build id: 20070208-1315Eclipse 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.exeMay 4, 2007 at 12:18 pm #269752
Riyad KallaMemberPlease 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.
May 9, 2007 at 9:27 am #269897
CytycMemberHi 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>May 9, 2007 at 2:02 pm #269909
Riyad KallaMemberCytyc,
Thank you, I’ll file it and have someone look at it. Just to clarify this is inside a HTML/JSP page right?May 17, 2007 at 12:21 pm #270250
CytycMemberhello, yes, this is within a script section of an html page.
-Cytyc
-
AuthorPosts
