En cours

validate form with javascript

I need only to put a existent code to validate form, a option to validate code to radio button too.

The code is the known MM_validateForm from Dreamweavers behaviors. I don´t know why this code is not ready to radio button too. I have the join the two codes:

if ([url removed, login to view]){

radioGroup = [url removed, login to view]["formulario"].elements["cidadeevento"];

validRadio = false;

for (i = 0; i < [url removed, login to view]; i++) {

validRadio = (validRadio || radioGroup[i].checked);

}

if (!validRadio) {alert("Você deve selecionar um dos dias do evento");}

and

function MM_validateForm() { //v4.0

var i,p,q,nm,test,num,min,max,errors='',args=[url removed, login to view];

for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=[url removed, login to view](args[i]);

if (val) { nm=[url removed, login to view]; if ((val=[url removed, login to view])!="") {

if ([url removed, login to view]('isEmail')!=-1) { p=[url removed, login to view]('@');

if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve conter um endereço de email.\n';

} else if (test!='R') { num = parseFloat(val);

if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';

if ([url removed, login to view]('inRange') != -1) { p=[url removed, login to view](':');

min=[url removed, login to view](8,p); max=[url removed, login to view](p+1);

if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';

} } } else if ([url removed, login to view](0) == 'R') errors += '- '+nm+' é requerido.\n'; }

} if (errors ) alert('Os seguintes erros ocorreram:\n'+errors);

document.MM_returnValue = (errors == '');

} }

And the asnwer to the errors joined too. And obvious, the form only send if all are complete.

Compétences : ASP, Javascript

Voir plus : test a javascript, substring c, substring 0 2, q email, c substring, mm_validateform radio button, max p, javascript max, val , c deve, ready javascript, javascript document ready, form radio, document ready javascript, max elements, button javascript, javascript forms, javascript ready, javascript alert form, email validate, contain javascript, substring, asp form email, email asp form, min max

Concernant l'employeur :
( 8 commentaires ) rio de janeiro, Brazil

N° du projet : #1613649

Décerné à :

kultech

I can done. Please check PM and my review.

30 $ USD en 0 jours
(19 Commentaires)
4.7

4 freelance font une offre moyenne de $30 pour ce travail

techfortune

Javascript expert! Ready to start now.

30 $ USD en 0 jours
(16 Commentaires)
4.9
aukint

Lets Start! your java validation.

30 $ USD en 0 jours
(3 Commentaires)
2.7
oasissoftwareinc

Hi, I have over 12 years of Experience in software design, development and implementation of various commercial applications in Client/Server environment, Web and ERP applications using C# 1.1/2.0/3.5, ASP.Net, VB.N Plus

30 $ USD en 1 jour
(0 Commentaires)
0.0