Thanks - I considered that option, but in this context, the postal/zip
code is only valid if it can be geocoded.  For example, if you buy a
house in a new development, you may not be able to find your code
yet.

I'm just using Google at this point for Geocoding.  It's pretty simple
and easy to use.

On Mar 12, 7:51 pm, Richtermeister <nex...@gmail.com> wrote:
> Why not use a field validator to validate the zip code, and then
> populate the lat/long after a successful form submission in a separate
> step.
> If you cache the calls to the Geocoding service (as you should since
> over time you'll have all zip/lat/long combinations), this won't add a
> second call.
>
> Hope this helps,
> Daniel
>
> PS: By the way, what service are you using? Curious :)
>
> On Mar 12, 10:03 am, wissl <andreas.wi...@googlemail.com> wrote:
>
> > Recently 
> > posted:http://blog.nevalon.de/en/wie-kann-ich-werte-nach-dem-abschicken-eine...
>
> > On 12 Mrz., 17:11, Java Guy <steve.san...@gmail.com> wrote:
>
> > > Hi,
>
> > > I have a user enter a postal code or zip code in my form.  Based on
> > > this entry, I am calling a Geocoding service and obtaining long/lat
> > > coordinates.  If the geocoder doesn't return coordinates, I want to
> > > return a validation error.  Otherwise, the postal code and the
> > > coordinates are stored in the database.
>
> > > I have thought the best way to do this would be use a post validator,
> > > but I'm trying to figure out how to inject the long/lat coordinates
> > > into my object.
>
> > > I've unset the long/lat coordinates in the form, because they are not
> > > meant for user entry or widget representation, but I need to access
> > > these fields somehow in order to set them in the object.  One way
> > > around this I guess would be to keep the fields in the widget schema,
> > > make them optional, and then return them as cleaned values in my post
> > > validator.
>
> > > I'm wondering if anyone has done anything like this and if you can
> > > recommend any approaches?
>
> > > Thanks,
> > > Steve
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to