Editing InputFields on prompt dialogs?

0 votes
asked Oct 31, 2016 in Help by anonymous
Hi,

I have a question regarding the prompt dialogs. Is it possible to edit the InputField on the prompt dialog? I would like to add a TextValidator and remove the floating hint and do some more stuff. Is this possible?

Thank you!
commented Nov 6, 2016 by anonymous
Can you help please?

1 Answer

0 votes
answered Nov 21, 2016 by admin (31,720 points)
selected Nov 22, 2016 by admin
 
Best answer
Hello!

Well, yes it sure is!
Once you've created the DialogPrompt, you'll have a reference to it. Like so:
DialogPrompt dialogPrompt = DialogManager.ShowPrompt...

You can just do:
dialogPrompt.firstInputField to access the MaterialInputField.
And with that you can do... pretty much anything?

- remove the floating hint:
dialogPrompt.firstInputField.floatingHint = false;

- add a textValidator
dialogPrompt.firstInputField.customTextValidator = yourTextValidatorHere;

Have a nice day!

~ Yohan
commented Nov 22, 2016 by anonymous
Thank you, it works great!
Welcome to MaterialUI support! Ask us anything :)
...