AJAX Zones with selects and validation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

AJAX Zones with selects and validation

Richard Frovarp
I'm missing something to make this all work correctly. JavaScript is
definitely not my strong suit, and I haven't fully caught up with how to
do things in 5.4.

I am doing the AJAX Select option from the Jumpstart.

http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/select1

First selection is country, with that then populating the list of
institutions. An autocomplete would be better, but that comes slightly
complicated with UTF characters and the different between the data
source and what the user would use. So that isn't a simple option.
However, this selection method is working fine.

However, I need to validate other items on the page, and I'm doing that
in Java. So it goes back to Java with onValidateFromForm. I perform
validation. If the validation fails, it kicks back to the page with the
country selected. However, the choice of institution is lost, and even
worse, the select list for institutions is blank. To recover one must
choose a different country, then go back to their country. That of
course isn't user friendly.

So I either need the institution select to have the right value after
onValidateFromForm fails, or I need to pull off validation somehow. I
see examples in Jumpstart, but I don't think those will work for what I
need. I don't want to implement the validator in JS, as that makes it a
lot more complicated. Right now my validating code is using Google's
phone validator. There is a JS port, but I would rather not use both.
Additionally, I think that the only way I have of making this easy is to
read the country value, and if they don't get things right for
US/Canada, is to insert a leading 1 country code so that the
international validator from the library works.

This is all easier if I use an embedded Solr or something that can do
the folding to take care of autocomplete, I just don't know if that is
more work than the fix for the above.

Any ideas are appreciated and/or any pointers to the documentation that
I appear to be unable to find.

Thanks

Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]