XLForm formValidationErrors for fields with no title displays "(null)"

865 Views Asked by At

Right now, for rows without title, "(null)" will be used in the alert for formValidationErrors

Is there a way to 1. hide the title of the row if I set it? OR 2. Make the alert search for the placeholder when title is absent?

It does make sense to use the placeholder in place of the title, since the rows look nicer using placeholders rather than titles.

Any help or suggestion is greatly appreciated! =D

3

There are 3 best solutions below

1
On BEST ANSWER
  1. You can override -(XLFormValidationStatus *) doValidation in XLFormRowDescriptor and set message to returned XLFormValidationStatus;

  2. You can override -(NSArray *)formValidationErrors in XLFormViewController, first NSError description returned is displayed.

  3. You can override -(void)showFormValidationError:(NSError *)error in XLFormViewController and display UIAlertView on your own.

I do not use it yet (considering currently) but this is how I see it from source code...

0
On

Set row.requireMsg to the text you would like to be displayed in the alert for formValidationErrors

0
On

i think you can do these steps

Go To your XLForm.m file where your define rows and colums.

See where you don't give the title to row if you don't want to give title just assign this line not empty.

  row = [XLFormRowDescriptor formRowDescriptorWithTag:@"nil)" rowType:XLFormRowDescriptorTypeText title:@""];

i think that is helpful.