Problem in clearing value of StringEdit Control

hi,

In ax 2012 i have a simple from which contains a string edit control. can anyone tell how to clear the value of textbox???

i have used “stringeditcontrol.text(” “)” code to clear the value. but it is not working… anyone suggest me solution…

Note: i ve written the code in lostfocus()

hi,

use table.field = '" "; in init method of form

or

stringeditcontrol.text() =" ";

Regards,

Nagaraj

hi nagaraj sir,

the solution is not working…

the second solution is saying that it is an syntax error…

If the text box u have is a bound control that would me for u to clear the value then u have to update the database .

for example . lets say your table is table1 and the field that is bound to your control is field1

then the statement table1.field1 = " "

i think the reason the second one is not working is because the stringeditcontrol has no method called the text().

and for the property text its used to set the label for the control and not the value.

hi angelus,

am using string edit control in which user types a text say email-id. in that lostfocus() of that control am validating, if they are correct they can proceed futher else i should clear the value of that control… this is the scenario…

is it bound to any datasource field

s sir

Then if its bound to a datasource field , then you would access the value using , Tablename.Fieldname ,

having this value now u can test if ts valid or not , if its not valid set it to an emptystring using tableName.fieldName = " "

then ensure the field is mandatory field so that users are not able to save with the string being empty or null

try this:

form - init()- write this after super()=stringeditcontrol.text(" ")

form -ds- active()- write this after super()=stringeditcontrol.text(" ")

Also note that " " is not an empty string - it’s a string containing a single “space” character. Use “” for empty string.