Re: [Cppcms-users] Setting field value after form.load() still fails validation
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-06-15 11:57:21
|
----- Original Message ----- > From: "ele...@ex..." <ele...@ex...> > To: cpp...@li... > Cc: > Sent: Friday, June 15, 2012 11:31 AM > Subject: Re: [Cppcms-users] Setting field value after form.load() still fails validation > > It's not a default value. > > The widget can either write an Int or YYYY-MM-DD in the widget. > > my overloaded form.load() uses regex to see if its an Int or Date. If it's > a date, it converts it to an Int based on some rules. > Why wouldn't you use regex_field widget or derive your own widget from the test widget? It would be more correct approach, you try to change the function of numeric widget and it is bad idea. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > The intention was to convert Date into Int before validation runs. The > field will then be validated as if it's an Int. > > I simply had to set num.valid(true) after the conversion to Int. > > My main point is that widgets::numeric::load silently validates the form, > when validation should be done when validate() is called. > > Petr > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |