Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
coil #1
Yaromat validations and "on submit" behavior
have yaromat form validations set up to validate form. on submit I have
behavior to go to a confirmation page. When form is fired yaromat is catching
the form errors, however it is still 'going to url' which is the the
confirmation page. Is there a quick fix for this? How can i get the form to
recognize the two behaviors in an order instead of firing both at once?
Thanks! :confused; code looks like this. YAROMAT GENERATED CODE:
<meta content='JavaScript' name='vs_defaultClientScript'> <script
language='JavaScript' type='text/JavaScript'> <!-- function MM_findObj(n, d) {
//v4.01 var p,i,x; if(!d) d=document;
if((p=n.indexOf('?'))>0&&parent.frames.len gth) {
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.l ength;i++)
x=MM_findObj(n,d.layers.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.replace(/\[\d+\]/ig,'')); myV=myObj.value; 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\.=-]+@[\\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]); if(myAt){
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);
if(myDate.getFullYear()!=myY||myDate.getDate()!=my D||myDate.getMonth()!=myM){add
Err=true}; }else{addErr=true} } 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,''));
if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,'')];
if(!myObj1.checked){addErr=true} } else if
(myV.length>0&&args[i+2]==6){ // the same var myObj1 =
MM_findObj(args[i+1]); if(myV!=myObj1.value){addErr=true} }
} else if
(!myObj.type&&myObj.length>0&&myOb j[0].type=='radio'){
var myTest = args.match(/(.*)\[(\d+)\].*/i); var
myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj; if
(args[i+2]==1&&myObj1&&myObj1.checked&&a mp;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'){
if(args[i+2]==1&&myObj.checked==false){addErr=true}
if(args[i+2]==2&&myObj.checked&&MM_findObj(arg s[i+1]).value.leng
th/1==0){addErr=true} } else if
(myObj.type=='select-one'||myObj.type=='select-multiple'){
if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true} }else if
(myObj.type=='textarea'){ if(myV.length<args[i+1]){addErr=true} }
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==''); }
function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments;
document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2)
eval(args+'.location=''+args[i+1]+'''); } //--> </script> </head> FORM CODE
FOLLOWS : <td vAlign='top'>
<form action='vacationConfirm.asp' method='post' name='frmEmail' id='frmEmail'
onSubmit='YY_checkform('frmEmail','name','#q','0', 'Please enter your
name.','email','#S','2','Please enter your email address. \(i.e.
[email]joe@att.com[/email]\)','dtStart','#^\([0-9][0-9]\)\/\([0-9][0-9]\)\/\([0-9]{4}\)$#1#2#3'
,'3','Please enter date as
DD/MM/YYYY','dtThrough','#^\([0-9][0-9]\)\/\([0-9][0-9]\)\/\([0-9]{4}\)$#1#2#3',
'3','Please enter date as DD/MM/YYYY.','phone','#q','0','Please enter your
phone number.','selectRequest','#q','1','You must select
one.','selectCode','#q','1','You must select
one.');MM_goToURL('parent','vacationConfirm.asp'); return
document.MM_returnValue'> <table width='600' border='0'
cellspacing='0' cellpadding='3'> <td
width='184'>&nbsp;</td> <td
width='366'>&nbsp;</td> <td>Your
Name</td> <td><input name='name' type='text'
id='name' size='45'></td> <td>Your
email </td> <td><input name='email' type='text'
id='email' size='45'></td> <td>I
would like to</td> <td>
<select name='selectRequest' id='selectRequest'>
<option selected>-- Select One --</option>
<option>Cancel</option> <option>Request</option>
</select></td>
<td>Select Payroll Code </td> <td><select
name='selectCode' id='selectCode'> <option
selected> -- Select Payroll Code -- </option>
<option>AVZ (extended unpaid vacation: NCS &gt; 1989)</option>
<option>EA2 (2 hours unpaid)</option>
<option>EA4 (4 hours unpaid)</option> <option>EA6
(6 hours unpaid)</option> <option>EAZ (8 hours
unpaid)</option> <option>EP2 (2 hours
paid)</option> <option>EP4 (4 hours paid)</option>
<option>EP6 (6 hours paid)</option> <option>EP8 (8 hours
paid)</option> <option>EPS (full day paid; non-flex)</option>
<option>HFS (floating holiday)</option> <option>HLS (floating holiday
carryover)</option> <option>NX (day off) (1 day request per month
only)</option> <option>PWS (carryover vacation)</option>
<option>PV4 (vacation half day)</option> <option>PVS (vacation
day)</option> <option>other (specify in 'Comment' field)</option>
</select></td> <td>Starting Date</td>
<td><input name='dtStart' type='text' id='dtStart'
size='15'> enter date as DD/MM/YYYY </td>
<td>Through Date </td> <td><input
name='dtThrough' type='text' id='dtThrough' size='15'>
enter date as DD/MM/YYYY </td>
<td>Phone</td> <td><input name='phone' type='text'
id='phone'></td> <td>Comments</td>
<td><textarea name='comment'
id='comment'></textarea></td> <td
colspan='2'><div align='center'> <input
type='submit' name='Submit' value='Submit'>
coil Guest
-
"yaromat" vs. "on submit"
have yaromat form validations set up to validate form. on submit I have behavior to go to a confirmation page. When form is fired yaromat is... -
Acrobat Form Submit error: changes VALUE="true" to "0"
I wrote an HTML page with a form. In the form I had many inputs as in: <INPUT TYPE="radio" NAME="Q1" VALUE="true"> and <INPUT TYPE="radio"... -
Can actionscript change a "Button's" "Behavior"?
While a movie is playing in "level 0" a button is pressed to launch another movie in "level 1". Is there a way to change the button that was pressed... -
#25366 [NEW]: form buttons of type "image" dont send "submit" $_POST variable in IE
From: jordanolsommer at imap dot cc Operating system: Windows XP PHP version: 4.3.2 PHP Bug Type: Variables related Bug... -
coil #2
Yaromat validations and "on submit" behavior
have yaromat form validations set up to validate form. on submit I have
behavior to go to a confirmation page. When form is fired yaromat is catching
the form errors, however it is still 'going to url' which is the the
confirmation page. Is there a quick fix for this? How can i get the form to
recognize the two behaviors in an order instead of firing both at once?
Thanks! :confused; code looks like this. YAROMAT GENERATED CODE:
<meta content='JavaScript' name='vs_defaultClientScript'> <script
language='JavaScript' type='text/JavaScript'> <!-- function MM_findObj(n, d) {
//v4.01 var p,i,x; if(!d) d=document;
if((p=n.indexOf('?'))>0&&parent.frames.len gth) {
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.l ength;i++)
x=MM_findObj(n,d.layers.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.replace(/\[\d+\]/ig,'')); myV=myObj.value; 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\.=-]+@[\\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]); if(myAt){
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);
if(myDate.getFullYear()!=myY||myDate.getDate()!=my D||myDate.getMonth()!=myM){add
Err=true}; }else{addErr=true} } 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,''));
if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,'')];
if(!myObj1.checked){addErr=true} } else if
(myV.length>0&&args[i+2]==6){ // the same var myObj1 =
MM_findObj(args[i+1]); if(myV!=myObj1.value){addErr=true} }
} else if
(!myObj.type&&myObj.length>0&&myOb j[0].type=='radio'){
var myTest = args.match(/(.*)\[(\d+)\].*/i); var
myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj; if
(args[i+2]==1&&myObj1&&myObj1.checked&&a mp;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'){
if(args[i+2]==1&&myObj.checked==false){addErr=true}
if(args[i+2]==2&&myObj.checked&&MM_findObj(arg s[i+1]).value.leng
th/1==0){addErr=true} } else if
(myObj.type=='select-one'||myObj.type=='select-multiple'){
if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true} }else if
(myObj.type=='textarea'){ if(myV.length<args[i+1]){addErr=true} }
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==''); }
function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments;
document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2)
eval(args+'.location=''+args[i+1]+'''); } //--> </script> </head> FORM CODE
FOLLOWS : <td vAlign='top'>
<form action='vacationConfirm.asp' method='post' name='frmEmail' id='frmEmail'
onSubmit='YY_checkform('frmEmail','name','#q','0', 'Please enter your
name.','email','#S','2','Please enter your email address. \(i.e.
[email]joe@att.com[/email]\)','dtStart','#^\([0-9][0-9]\)\/\([0-9][0-9]\)\/\([0-9]{4}\)$#1#2#3'
,'3','Please enter date as
DD/MM/YYYY','dtThrough','#^\([0-9][0-9]\)\/\([0-9][0-9]\)\/\([0-9]{4}\)$#1#2#3',
'3','Please enter date as DD/MM/YYYY.','phone','#q','0','Please enter your
phone number.','selectRequest','#q','1','You must select
one.','selectCode','#q','1','You must select
one.');MM_goToURL('parent','vacationConfirm.asp'); return
document.MM_returnValue'> <table width='600' border='0'
cellspacing='0' cellpadding='3'> <td
width='184'>&nbsp;</td> <td
width='366'>&nbsp;</td> <td>Your
Name</td> <td><input name='name' type='text'
id='name' size='45'></td> <td>Your
email </td> <td><input name='email' type='text'
id='email' size='45'></td> <td>I
would like to</td> <td>
<select name='selectRequest' id='selectRequest'>
<option selected>-- Select One --</option>
<option>Cancel</option> <option>Request</option>
</select></td>
<td>Select Payroll Code </td> <td><select
name='selectCode' id='selectCode'> <option
selected> -- Select Payroll Code -- </option>
<option>AVZ (extended unpaid vacation: NCS &gt; 1989)</option>
<option>EA2 (2 hours unpaid)</option>
<option>EA4 (4 hours unpaid)</option> <option>EA6
(6 hours unpaid)</option> <option>EAZ (8 hours
unpaid)</option> <option>EP2 (2 hours
paid)</option> <option>EP4 (4 hours paid)</option>
<option>EP6 (6 hours paid)</option> <option>EP8 (8 hours
paid)</option> <option>EPS (full day paid; non-flex)</option>
<option>HFS (floating holiday)</option> <option>HLS (floating holiday
carryover)</option> <option>NX (day off) (1 day request per month
only)</option> <option>PWS (carryover vacation)</option>
<option>PV4 (vacation half day)</option> <option>PVS (vacation
day)</option> <option>other (specify in 'Comment' field)</option>
</select></td> <td>Starting Date</td>
<td><input name='dtStart' type='text' id='dtStart'
size='15'> enter date as DD/MM/YYYY </td>
<td>Through Date </td> <td><input
name='dtThrough' type='text' id='dtThrough' size='15'>
enter date as DD/MM/YYYY </td>
<td>Phone</td> <td><input name='phone' type='text'
id='phone'></td> <td>Comments</td>
<td><textarea name='comment'
id='comment'></textarea></td> <td
colspan='2'><div align='center'> <input
type='submit' name='Submit' value='Submit'>
coil Guest
-
danilocelic *TMM* #3
Re: Yaromat validations and "on submit" behavior
Please do not start another thread with the same question, it makes it
harder for folks to help you appropriately as well as others to find the
resolution of the issue. .
Refer to your original question:
[url]http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=190&threadid=971828[/url]
--
Danilo Celic
| Extending Knowledge Daily : [url]http://CommunityMX.com/[/url]
| Team Macromedia for Dreamweaver : [url]http://macromedia.com/go/team/[/url]
danilocelic *TMM* Guest



Reply With Quote

