View Full Version : hello guys , i am new with this n need help

Aug 24th, 2003, 11:09 PM
I have some code that validates a form , i used yaromat in dreamweaver to create it , but it does not check for free emails.
i want it to exclude hotmail and yahoo email addresses.

I will also attach the whole page.
can one of you wizards out there please show me what i need to add.

Please help me on this one ...

heres the code i have

<script language="JavaScript">
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[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;

function YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
for (var i=1; i<args.length;i=i+4){
if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
if (myReq&&myObj.value.length==0){addErr=true}
if ((myV.length>0)&&(args[i+2]==1)){ //fromto
var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
} else if ((myV.length>0)&&(args[i+2]==2)){
var rx=new RegExp("^[\\w\.=-][email protected][\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
} else if ((myV.length>0)&&(args[i+2]==3)){ // date
var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
var myDate=new Date(myY,myM,myD);
} else if ((myV.length>0)&&(args[i+2]==4)){ // time
var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
} else if (myV.length>0&&args[i+2]==5){ // check this 2
var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
} else if (myV.length>0&&args[i+2]==6){ // the same
var myObj1 = MM_findObj(args[i+1]);
} else
if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
if (args[i+2]==2){
var myDot=false;
for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
if(!myDot){myErr+='* ' +args[i+3]+'\n'}
} else if (myObj.type=='checkbox'){
} else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
}else if (myObj.type=='textarea'){
if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
if (myErr!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+myErr)}
document.MM_returnValue = (myErr=='');

this is on the submit button

<input type="image" name=proceed value="submit" src="../../ultimate_images/button-continue.gif" width="132" height="35" onClick="YY_checkform('frmdetails','terms','#q','1','Please agree to our terms and conditions.','firstname','#q','0','Please Enter your First Name.','surname','#q','0','Please Enter your Surname.','email','S','2','Please Enter your E-mail address.','address1','#q','0','Please Enter your Address.','town','#q','0','Please Enter your Town.','county','#q','0','Please Enter your County / State.','postcode','#q','0','Please Enter your Postcode / Zip.');return document.MM_returnValue">

Thankyou for your help.

Aug 24th, 2003, 11:14 PM
heres the html attachment
thankyou if you can help me with my problem.

ok i cant attach an html file , urrrr.
ok i will post the entire html below .


nope cant do that cos not enough space...

If someone will help me please email me at [email protected] and i will email the page across..

Thanks for your help

Aug 24th, 2003, 11:18 PM
Please read our posting guidelines (http://www.codingforums.com/postguide.htm), specifically the section about naming your thread.

Aug 24th, 2003, 11:24 PM
hey i am new to the forum sorry ... nice welcome ...

sorry guys , i will take better care next time :o
can u help with the problem i have above ?
Kind Regards