The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
		
			|  | 
			
		
			|  | 
				
					| Validate legacy input with Active Script?  Posted: 01 May 08 5:04 PM
 |  
					| I'm working in SLX 6.2.   I have a legacy form that I want to validate with an Active Script, just because I prefer to work with Active Scripts. 
 So how to I do set the postable property of a legacy form to true or false using an active script?
 |  
					|  |  | 
			|  | 
				
					| Re: Validate legacy input with Active Script?  Posted: 02 May 08 7:08 AM
 |  
					| Just convert the legacy form over to "Activex".. it's the "best practice" thing to do no hastle. 
 Use the "forms converter" in the Architect if you do not want to do it manually. We do it all the time.
 --
 RJLedger - rjlSystems
 |  
					|  |  | 
			|  | 
				
					| Re: Validate legacy input with Active Script?  Posted: 02 May 08 11:20 AM
 |  
					| Hi Dan, 
 You could also do something like this using a VBScript attached to the WhenValidate of the legacy form:
 
 Sub Main
 Dim i
 Dim frm
 Dim blnResult
 
 'Loop through the open forms
 For i = 0 to Application.Forms.Count - 1
 'Find the Add Contact Screen form.
 If Application.Forms(i).Name = "frmAddContactScreen" Then
 'Save the reference to this form
 Set frm = Application.Forms(i)
 End If
 Next
 
 'Do your validation - checking email address has something in
 If len(frm.cdEmail.Text) <> 0 Then
 blnResult = True
 Else
 blnResult = False
 End If
 'Validation Result
 frm.Postable = blnResult
 'Clean Up
 Set frm = Nothing
 End Sub
 
 But upgrading the forms is the better way to go.
 
 Cheers,
 
 Steve
 |  
					|  |  | 
			|  |  | 
			|  |