LiveZilla Live Help
 


Go Back   Chime Host - Web Hosting Forum > World Wide Web > Programming / Scripting / Coding Forum > Javascript
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Javascript Need help with the (primarily) client-side programming language? This is the place. Includes discussion on AJAX (Asynchronous JavaScript and XML).

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-26-2009, 02:54 AM
Junior Member
 
Join Date: Oct 2009
sehuds2 is on a distinguished road
Default XML file validation with JavaScript?

Need some help trying to figure out if this XML/Javascript seems logical. Mainly I want to make sure that the logic on the errors is right. If the ValidWhen variable fails, I want error 1. If the ValidWhen2 variable section fails, I want error2.

I was thinking there was a connection between the variable name and the msg name?

<javascript>
boolean MyTestPassed= false;
int NumberOne = 10;
int NumberTwo = 15;

if (Field1 !=null) {
if (Field1 >= NumberOne & Field1 <= NumberTwo)
{
MyTestPassed=true;
return MyTestPassed;
}

else if (Field1 = null) {
MyTestPassed = true;
return MyTestPassed;
}
else MyTestPassed = false;
}
</javascript>

<field property="Field1.entered" depends="validwhen">
<msg name="validwhen" key = "error1.fail"/>
<msg name="validwhen2" key ="error2.fail"/>
<var>
<var-name>validwhen</var-name>
<var-value>
(
(
(
*this* == 'true'
)
and
(
(fielda !=null) and
(field2 !=null)
)
)
or
(
*this* == 'false'
)
)
<var-value>
</var>
<var>
<var-name>validwhen2</var-name>
<var-value>
(
(
(
*this* == 'true'
)
and
(
(MyTestPassed = true)
)
or
(
*this* == 'false'
)
)
<var-value>
</var>
</field>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
php code, email forms/validation? Twist PHP 0 10-18-2009 01:26 PM
how to implement javascript in a php file REGINE Javascript 0 06-04-2007 11:29 PM
How to use javascript in asp.net 2.0 priya Javascript 0 05-25-2007 01:06 AM
validation zerogforce Web Hosting Support 3 03-20-2007 10:11 AM
Why I can't upload file with File Manager in cPanel ? mophoc2k Web Hosting Support 2 02-06-2006 10:26 PM


All times are GMT +1. The time now is 08:44 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ChimeHost, a Profuse Solutions LLC company