PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > macromedia.dyna.html > SpryValidation
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
SpryValidation

Réponse
 
LinkBack Outils de la discussion
Vieux 18/04/2008, 19h40   #1
Hidrogeno
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut SpryValidation

Hi there, I'm wondering if any of you guys can give me a hand.
I'm using "SpryValidation" for TextFields and List/Menu to validate
a form. It normally works fine. However, this time I am trying to send the
form to 2 different URLs and unfortunately it does not validate at all.

To submit the form to two URLs I add "onsubmit="setTimeout(ReSubmit,1000)"
to the <form> tag.

<form method="post" name="myform" action="http://www.url_one.com"
onsubmit="setTimeout(ReSubmit,1000)"/>

And of course the function in the <head> tag:

<script language="Javascript">
<!--
function ReSubmit(){
f=document.myform;
f.action='http://www.url_two.com;
f.submit();
}
-->
</script>

Why is "onsubmit" affecting the validation script linked to the page
(e.i..."SpryValidationSelect.js" and SpryValidationSelect.js).
Isn't supposed to do the validation before actually clicking on the
submit button? Or how can I tell it to check for validation first then
submit?

Thank you for your time guys...

  Réponse avec citation
Vieux 22/04/2008, 18h05   #2
Hidrogeno
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SpryValidation

I'm pretty sure at one point or another you guys
are going to come across the same issue.

After a little bit of research (yeah...alright!) I found
this tutorial that kind of explains what to do when
validation doesn't work because of "onSubmit"

http://cates-associates.net/tutorial...CS3-forms.html

This function ed me solve the problem of validating.

<script type="text/javascript">
<!--
// handle form submit & validate
function SendForm(myform) {
var theForm = typeof myform != 'object' ? document.getElementById(myform):
myform;
var ret = Spry.Widget.Form.validate(theForm);
if (ret) {
ReSubmit();
}
return false;
};
//-->
</script>

"Spry.Widget.Form.validate" (look in external .js files) is the function
that checks validation for all textfields, textareas, list/menus, etc.

Thank you

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 06h54.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07538 seconds with 10 queries