Aaron Kin g Posted April 14, 2010 Share Posted April 14, 2010 Hello Everyone I'm having an issue with the pop up calendars on my site. They used to work fine, but now they pop up in random places on the page if they pop up at all. I'm just starting my programming education, and wanted to know if its easier to try to fix the existing calendars, or to replace them with something else. I'll post the script for one of the pages below, any help is greatly appreciated. Thank you. -Aaron <? session_start(); if(!session_is_registered("Ssn_Type")){ header("Location: index.php"); exit; } include("../classes/funciones.php"); include("../classes/connquery.php"); include("../classes/company.php"); include("../classes/users.php"); include("../classes/order.php"); include("../classes/instructions.php"); $ObjOrder = new order(); $ObjUsers = new users(); $ObjCompany = new company(); $ObjInstruction = new instruction(); $ObjInstruction->Consultar("","",25,0); if($Control == 1){ $Field['OrderDate'] = BackToSQLFormat($Field['OrderDate'],"."); $Field['AppointmentDate'] = BackToSQLFormat($Field['AppointmentDate'],"."); $Field['WorkPhone'] = $Field['WorkPhone']." ". $ext1; $Field['WorkPhoneCo'] = $Field['WorkPhoneCo']." ". $ext2; $ClientBranch = explode(",",$Field['ClientBranch']); $Field['ClientBranch'] = $ClientBranch[0]; $ObjOrder->NewOrder($Field); /* if($ObjOrder->NewOrder($Field)){ //header("Location: neworder.php"); //exit; }else{ $Error = "An error occurred while saving, please try again."; }*/ } ?><html><!-- InstanceBegin template="/Templates/InternaNewOrder.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>New Order</title> <!-- InstanceEndEditable --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="../estilos.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <!-- InstanceBeginEditable name="head" --> <script language="javascript" src="../javascript/calendar.js"></script> <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.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 YY_checkform() { //v4.66 //copyright ©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()!=myD||myDate.getMonth()!=myM){addErr=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&&myObj[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&&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(args[i+1]).value.length/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) }else{ document.form1.Control.value = 1; document.getElementById('Save').disabled=true; document.form1.submit(); } document.MM_returnValue = (myErr==''); } //--> </script> <script> function DeliverInstruction(Select){ Seleccionado = Select.value; Campo = document.getElementById("Deliver"); Layer = document.getElementById("DI"); Layer.className = 'Visible'; Campo.value = ''; switch(Seleccionado){ <? for($i=0; $i<$ObjInstruction->NumeroRegistros; $i++){ if($ObjInstruction->Option != "Mail"){ echo "\tcase \"".$ObjInstruction->Option."\":\n\t\t\t\t"; $Linea = explode("\n",trim($ObjInstruction->Instruction)); for($j=0; $j<count($Linea); $j++){ $Linea[$j] = trim($Linea[$j]); if(!empty($Linea[$j])) echo "Campo.value += \"". addslashes($Linea[$j]) ."\\n\";\n\t\t\t\t"; else echo "Campo.value += \"\\n\";\n\t\t\t\t"; } echo "Layer.className = 'Visible';\n\t\t\t\t"; echo "break;\n\t\t"; } $ObjInstruction->Siguiente(); } ?> default: Campo = ''; Layer.className = 'Oculto'; } } </script> <style type="text/css"> <!-- .Oculto { display: none; } .Visible { display: inherit; } .Estilo3 {FONT-SIZE: 11px; LINE-HEIGHT: 11px; MARGIN-TOP: 3px; MARGIN-BOTTOM: 3px; MARGIN-LEFT: 10px; clip: rect(0px 0px 0px 0px); color: #000000; font-family: arial, 'arial narrow', verdana, sans-serif;} --> </style> </head> <body> <? include "header_order.php" ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="21" class="GreenColorMenu"><img src="../images/spacer.gif" width="40" height="8"><img src="../images/nd_title_new_order.jpg" width="142" height="18"></td> </tr> <tr> <td height="19" valign="bottom" background="../images/nd_blank.gif"> </td> </tr> </table> </td> </tr> <tr> <td valign="top"><img src="../images/spacer.gif" width="15" height="10"> <span class="Titulo"><img src="../images/spacer.gif" width="15" height="10"></span> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="Justificado"><img src="../images/spacer.gif" width="15" height="5"></td> </tr> <tr> <td class="Justificado"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="1%"><img src="../images/spacer.gif" width="10" height="8"></td> <td width="99%" valign="top"> <form action="neworder.php" method="get" enctype="multipart/form-data" name="form1" target="_self"> <table width="760" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="39" valign="top"><span class="Titulo"><img src="/images/spacer.gif" width="25" height="1">New Order </span></td> <td height="39" colspan="2" align="left" valign="middle"><?=$Error?></td> </tr> <tr> <td width="307" height="39" valign="top" background="../images/nd_step1_back.jpg" class="GreenStep1 "><img src="../images/nd_step1.jpg" width="47" height="39"></td> <td width="226" height="39" background="../images/nd_step2_back.jpg"><img src="../images/nd_step2.jpg" width="47" height="39"></td> <td width="227" height="39" background="../images/nd_step3_back.jpg" class="GreenBorderRight"><img src="../images/nd_step3.jpg" width="47" height="39"></td> </tr> <tr> <td align="center" valign="top" class="GreenBorderLeft GreenStep1"><table width="95%" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="2" class="Subtitulo"> </td> </tr> <tr> <td colspan="2" class="Subtitulo">Order Information </td> </tr> <tr> <td class="dark_black_h4"> </td> <td> </td> </tr> <tr> <? $ClientBranch = explode(",",$Field[ClientBranch]); $Field['ClientBranch'] = $ClientBranch[0]; $Field['CompanyId'] = $ClientBranch[1]; ?> <td width="33%" class="dark_black_h4">Client/Branch*:</td> <td width="67%"><select name="Field[ClientBranch]" id="Field[ClientBranch]" onChange="document.form1.submit();"> <option>Select a Client/Branch</option> <?=$ObjCompany->CompanySelect($Field['ClientBranch'],$Ssn_CompanyId)?> </select> <input name="Field[CompanyId] " type="hidden" id="Field[CompanyId] " value="<?=$ClientBranch[1];?>"> </td> </tr> <tr> <td width="33%" class="dark_black_h4">Product*:</td> <td width="67%"><select name="Field[Product]" id="Field[Product]"> <option>Select a Product</option> <?=($Field['ClientBranch'] != "" && $Field['ClientBranch'] != "Select a Client/Branch") ? $ObjCompany->ProductSelect($Field['ClientBranch']):""?> </select></td> </tr> <tr> <td class="dark_black_h4">Appt Date/Time:</td> <td class="dark_black_h4"><input name="Field[AppointmentDate]" type="text" id="Field[AppointmentDate]" size="10" onFocus='javascript:popUpCalendar(this, this, "mm.dd.yyyy"); this.blur(); return false;'> <select name="Field[Time]" id="Field[Time]"> <option value="Not set">Not Set</option> <option value="Morning">Morning</option> <option value="Afternoon">Afternoon</option> <option value="Evening">Evening</option> <? for($i=6;$i<12;$i++){ ?> <option value="<?=$i?>:00 A.M."> <?=$i?> :00 A.M.</option> <option value="<?=$i?>:30 A.M."> <?=$i?> :30 A.M.</option> <? } ?> <option value="12:00 P.M."<?=ValidateSelection("12:00 P.M.",$ObjOrder->Time);?>>12:00 P.M.</option> <option value="12:30 P.M."<?=ValidateSelection("12:30 P.M.",$ObjOrder->Time);?>>12:30 P.M.</option> <? for($i=1;$i<12;$i++){ ?> <option value="<?=$i?>:00 P.M."> <?=$i?> :00 P.M.</option> <option value="<?=$i?>:30 P.M."> <?=$i?> :30 P.M.</option> <? } ?> <option value="<?=$i?>:00 A.M."<?=ValidateSelection("$i:00 A.M.",$ObjOrder->Time);?>> <?=$i?> :00 A.M.</option> <option value="<?=$i?>:30 A.M."<?=ValidateSelection("$i:30 A.M.",$ObjOrder->Time);?>> <?=$i?> :30 A.M.</option> </select></td> </tr> </table> <table width="95%" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="2" class="dark_black_h4"><hr width="250" class="Titulo"></td> </tr> <tr> <? $ClientBranch = explode(",",$Field[ClientBranch]); $Field[ClientBranch] = $ClientBranch[0]; $Field['CompanyId'] = $ClientBranch[1]; ?> <td width="34%" class="dark_black_h4">Order Date:</td> <td width="66%" class="bigblack"><?=date("m.d.Y")?> <input name="Field[OrderDate]" type="hidden" id="Field[OrderDate]" value="<?=date("m.d.Y")?>"> <input name="Field[OrderTime]" type="hidden" id="Field[OrderTime]" value="CURRENT_TIMESTAMP"></td> </tr> <tr> <td class="dark_black_h4">Lender/Broker:</td> <td><input name="Field[Lender]" type="text" id="Field[Lender]"> <input name="Field[TypeLoan]" type="hidden" id="Field[TypeLoan]"> </td> </tr> <? $ObjUsers->UserSearch($_SESSION['Ssn_User']);?> <tr> <td class="dark_black_h4">Loan Number/ Escrow Number:</td> <td><input name="Field[LoanNumber]" type="text" id="Field[LoanNumber]"></td> </tr> </table> <p> </p></td> <td align="center" valign="top" class="GreenStep2"><table width="95%" border="0" cellpadding="0" cellspacing="2"> <tr> <td colspan="3" class="dark_green_h4"> </td> </tr> <tr> <td colspan="3" class="dark_green_h4"><div align="left" class="Subtitulo">Borrower Information</div></td> </tr> <tr> <td class="dark_black_h4"> </td> <td colspan="2"> </td> </tr> <tr> <td width="37%" class="dark_black_h4">First Name*:</td> <td colspan="2"><input name="Field[FirstName]" type="text" id="FirstName2"></td> </tr> <tr> <td width="37%" class="dark_black_h4">Last Name*:</td> <td colspan="2"><input name="Field[LastName]" type="text" id="LastName2"></td> </tr> <tr> <td width="37%" height="22" class="dark_black_h4">Address1*:</td> <td colspan="2"><input name="Field[Address1]" type="text" id="Address12"></td> </tr> <tr> <td width="37%" class="dark_black_h4">City*:</td> <td colspan="2"><input name="Field[City]" type="text" id="City2"></td> </tr> <tr> <td width="37%" class="dark_black_h4">State*:</td> <td width="63%" class="blacktext"><select name="Field[state]" id="select"> <option value="AL">AL</option> <option value="AK">AK</option> <option value="AZ">AZ</option> <option value="AR">AR</option> <option value="CA">CA</option> <option value="CO">CO</option> <option value="CT">CT</option> <option value="DE">DE</option> <option value="DC">DC</option> <option value="FL">FL</option> <option value="GA">GA</option> <option value="HI">HI</option> <option value="ID">ID</option> <option value="IL">IL</option> <option value="IN">IN</option> <option value="IA">IA</option> <option value="KS">KS</option> <option value="KY">KY</option> <option value="LA">LA</option> <option value="ME">ME</option> <option value="MD">MD</option> <option value="MA">MA</option> <option value="MI">MI</option> <option value="MN">MN</option> <option value="MS">MS</option> <option value="MO">MO</option> <option value="MT">MT</option> <option value="NE">NE</option> <option value="NV">NV</option> <option value="NH">NH</option> <option value="NJ">NJ</option> <option value="NM">NM</option> <option value="NY">NY</option> <option value="NC">NC</option> <option value="ND">ND</option> <option value="OH">OH</option> <option value="OK">OK</option> <option value="OR">OR</option> <option value="PA">PA</option> <option value="RI">RI</option> <option value="SC">SC</option> <option value="SD">SD</option> <option value="TN">TN</option> <option value="TX">TX</option> <option value="UT">UT</option> <option value="VT">VT</option> <option value="VI">VI</option> <option value="VA">VA</option> <option value="WA">WA</option> <option value="WI">WI</option> <option value="WV">WV</option> <option value="WY">WY</option> </select> </td> </tr> <tr> <td class="dark_black_h4"> Zip*: </td> <td colspan="2"> <input name="Field[Zip]" type="text" id="Zip2" size="12"> </td> </tr> <tr> <td width="37%" class="dark_black_h4">Home Phone*:</td> <td colspan="2"><input name="Field[HomePhone]" type="text" id="HomePhone2" size="14"></td> </tr> <tr> <td width="37%" class="dark_black_h4">Work Phone*:</td> <td colspan="2" class="blacktext"><input name="Field[WorkPhone]" type="text" id="WorkPhone2" size="14"> </td> </tr> <tr> <td width="37%" class="dark_black_h4">Cell Phone:</td> <td colspan="2"><input name="Field[CellPhone]" type="text" id="Field[CellPhone]" size="14"></td> </tr> <tr> <td class="dark_black_h4"> </td> <td colspan="2"> </td> </tr> <tr> <td class="dark_black_h4"> </td> <td colspan="2"> </td> </tr> </table></td> <td valign="top" class="GreenStep3 GreenBorderRight"><table width="98%" border="0" align="right" cellpadding="0" cellspacing="2"> <tr> <td height="12" colspan="2" class="dark_green_h4"> </td> </tr> <tr> <td height="12" colspan="2" class="dark_green_h4"><div align="left" class="Subtitulo">Co-Borrower Information</div></td> </tr> <tr> <td class="dark_black_h4"> </td> <td> </td> </tr> <tr> <td width="34%" class="dark_black_h4">First Name:</td> <td width="66%"><input name="Field[FirstNameCo]" type="text" id="FirstNameCo2"></td> </tr> <tr> <td width="34%" height="22" class="dark_black_h4">Last Name:</td> <td width="66%"><input name="Field[LastNameCo]" type="text" id="LastNameCo2"></td> </tr> <tr> <td width="34%" class="dark_black_h4">Work Phone:</td> <td width="66%" class="blacktext"><input name="Field[WorkPhoneCo]" type="text" id="WorkPhoneCo2" size="14"> <br> </td> </tr> <tr> <td width="34%" class="dark_black_h4">Cell Phone:</td> <td width="66%"><input name="Field[CellPhoneCo]" type="text" id="Field[CellPhoneCo]" size="14"></td> </tr> </table></td> </tr> <tr> <td colspan="3" class="GreenBorderRight GreenBorderLeft"><img src="../images/spacer.gif" width="1" height="5"></td> </tr> <tr class="ColorFooter"> <td height="38" colspan="3" class="GreenBorderLeft GreenBorderRight GreenBorderBottom"><table width="100%" border="0" cellspacing="3" cellpadding="0"> <tr align="center" class="LetrasBlancas"> <td width="8%" align="center" class="dark_white_h4"> </td> <td width="24%" align="center"> </td> <td colspan="4" align="center"><div id="DI" class="Oculto"><span class="dark_white_h4">Notary Instructions:</span><br><textarea name="Deliver" cols="50" rows="3" readonly="readonly" id="Deliver" class="BorderGreenColor GreenStep3"></textarea> </div></td> </tr> <tr class="LetrasBlancas"> <td class="dark_white_h4"> </td> <td class="dark_white_h4">Documents Sent To: </td> <td width="16%" class="dark_white_h4">Via:</td> <td width="29%" class="dark_white_h4">E-doc Format (If applicable):</td> <td width="10%" align="left"> </td> <td align="left"> </td> </tr> <tr class="LetrasBlancas"> <td class="dark_white_h4"> </td> <td class="dark_white_h4"> <select name="Field[DocumentSent]" id="Field[DocumentSent]"> <option value="Notary">Notary</option> <option value="Borrower">Borrower</option> <option value="Other">Other</option> </select></td> <td class="dark_white_h4"><select name="Field[DocumentDelivered]" id="Field[DocumentDelivered]"> <option value=""></option> <option value="DHL">DHL</option> <option value="Email">Email</option> <option value="Fax">Fax</option> <option value="FedEx">Fedex</option> <option value="Mail">Mail</option> <option value="UPS">UPS</option> </select></td> <td colspan="2"><span class="dark_white_h4"> <select name="Field[DocumentFormat]" id="Field[DocumentFormat]"> <option value="-----">-----</option> <option value="SwiftView">Swift View</option> <option value="PDF">PDF</option> <option value="DocMagic">DocMagic</option> <option value="DesertDocs">DesertDocs</option> <option value="Other">Other</option> </select> </span> </td> <td width="13%" align="left"> </td> </tr> <tr align="center" class="LetrasBlancas"> <td align="center" class="dark_white_h4"> </td> <td align="left" class="LetrasBlancas"> </td> <td colspan="4" align="center"> </td> </tr> <tr align="center" class="LetrasBlancas"> <td align="center" class="dark_white_h4"> </td> <td align="left" class="LetrasBlancas"> </td> <td colspan="4" align="center"> </td> </tr> </table></td> </tr> </table> <table width="760" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="3%"> </td> <td width="18%"> </td> <td width="79%"> </td> </tr> <tr> <td> </td> <td> </td> <td><span class="Subtitulo">Special Instructions</span></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> <input type="hidden" name="Field[status]" value="1"> <input name="Field[Problems]" type="hidden" id="Field[Problems]" value="No"> <input name="Field[ClientUser]" type="hidden" id="Field[ClientUser]" value="<?=$_SESSION['Ssn_User']?>"> <input name="Field[EmailAddress]" type="hidden" id="Field[EmailAddress]" value="<?=$ObjUsers->Email?>"> <input name="Control" type="hidden" id="Control" value="0"> <input name="Save" type="image" class="botonsubmit" id="Save" src="../images/nd_submit.jpg" onClick="YY_checkform('form1','Field[OrderDate]','^\([0-9][0-9]\)\\.\([0-9][0-9]\)\\.\([0-9]{4}\)$#2#1#3','3','Field Order date is not valid.','FirstName2','#q','0','Field \'FirstName of the borrower\' is required.','LastName2','#q','0','Field \'Last Name of the Borrower\' is required.','Address12','#q','0','Field \'Address of the Borrower\' is required.','City2','#q','0','Field \'City of the Borrower\' is required.','Zip2','0_10000000000000000000000','1','Field \'Zip2\' is invalid.','Field[ClientBranch]','#q','1','Client / Branch is required.');return document.MM_returnValue"></td> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <textarea name="Field[OrderInstructions]" cols="100" rows="3" class="BorderGreenColor GreenStep3" id="textarea14"></textarea> </td> </tr> <tr> <td> </td> </tr> </table></td> </tr> <tr> <td> </td> <td><em>* Field required.</em></td> <td> </td> </tr> </table> </form> <!-- InstanceEndEditable --></td> </tr> </table></td> </tr> </table></td> </tr> </table> </body> <!-- InstanceEnd --></html> Quote Link to comment Share on other sites More sharing options...
seventheyejosh Posted April 15, 2010 Share Posted April 15, 2010 Use code tags for the love of god! [ code ] // that mess you have [ /code ] with no spaces in between the brackets... Quote Link to comment Share on other sites More sharing options...
Aaron Kin g Posted April 15, 2010 Author Share Posted April 15, 2010 Ah.. Im new to this; thanks for the tip. Unfortunately I can't edit or delete anything on here... Quote Link to comment Share on other sites More sharing options...
Psycho Posted April 15, 2010 Share Posted April 15, 2010 Also, if you want help with a JavaScript problem do not post pre-processed server-side code. There is no way for us to know what is in those included files and variables that may, or may not, be affecting the JavaScript. In this case, since you have absolutely no clue what relevant code to post, you should just post a link to the page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.