![]() |
| ||||||||||
| |||||||
| 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). |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| 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> |
![]() |
| Thread Tools | |
| Display Modes | |
| |
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 |