[Cartoweb-users] Checking form

Jacolin Yves yjacolin at free.fr
Wed Jun 7 10:20:16 EDT 2006


Hi,
I don't know javascript so I will maybe ask some bad question but it is 
possible to run a javascript function from the doSubmit function in 
dhtmlInit.js which is write in 
plugins/layersManager/htdocs/js/layersManager.js ?

Or do you plan to do something like for plugin (ie automatic inclusion in main 
page from plugin file) ? This is just a question, well, for fun ;-)

If I want to interact with forms using javascript, there is no way to do it 
correctly (ie with no hack) ?

Thank you !

Y.
Le Mercredi 7 Juin 2006 16:10, Pierre GIRAUD a écrit :
> Jacolin Yves wrote:
> >Hi,
> >I would like to check my form after submit it. Is there a way to run a
> >javascript code to check my form with onsubmit="". The javascript code
> > will be in the htdocs/js/layersManager.js file of my plugin.
> >
> >Thanks,
> >
> >Y.
>
> In the dhtmlInit.js you have a doSubmit() method that is called in
> almost all cases when the form is submited.
> You can override this file in your project. And modify the content of
> the method.
>
> You can also add this snipet of code at the end of the head element of
> your plugin main template (cartoclient.tpl) :
>
> <script>
> {literal}
> /**
>  * Submits the form
>  * Overrides the standard method set in dhtmlInit.js
>  */
> doSubmit = function() {
>   theFormCheckMethod();
>   xShow(xGetElementById('loadbarDiv'));
>   myform = document.forms['carto_form'];
>   myform.submit();
> };
> {/literal}
> </script>
>
> This is like a hack but it is the quickest way to get this working,
> IMHO. Althought, I didn't really test it.
>
> Regards
>
> Pierre
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users

-- 
Yves Jacolin
http://yjacolin.gloobe.org
----
Stagaire Conservatoire Régional des Espaces Naturels de la région Centre
http://cahiersnaturalistes.free.fr/cpnrc/
----
- Qu'est-ce que cela peut faire que je lutte pour la mauvaise cause 
puisque je suis de bonne foi?
- Et qu'est-ce que ça peut faire que je sois de mauvaise foi
puisque c'est pour la bonne cause. (Jacques Prévert)



More information about the Cartoweb-users mailing list