Ask a Question related to Dreamweaver AppDev, Design and Development.
-
MarkTaz #1
macromedia Validation JavaScript Cross browswercompatibility
Hi all, I am having a problem getting the Macromedia auto validation to work on
firefox. It works fine in IE 6.0 Here is a copy of the code I am talking
about...
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail
address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number
between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n';
}
}
Any and all help would be greatly appreciated.
Thanks
MarkTaz Guest
-
flash / javascript cross-domain
Hi, I have a problem. I have an html on server A (www.serverA.com), and swf file on another server ( server B - www.serverB.com). I need to be... -
Newbie:Is Javascript validation really the best way to go?
Hello to all, I remember reading somewhere that JavaScript validation is superior to CF validation and not to even use CF for that. Is this... -
Javascript Validation
C wrote: This can be done with client-side code using the onkeypress event. Please follow-up in a javascript dhtml newsgroup since this question... -
JavaScript validation of a DataList
Hello all, I have a DataList control displaying data from the database (some products). There are also TexBox controls and ImageButton controls... -
Anyone know of a good Client Side form validation tutorial thats cross browser....
Definately NOT goign to want to use VBScript for client-side validation.... it's IE specific. You'll want to look at javascript most likely. ...



Reply With Quote

