Hello all!
I have a page with multiple forms on it and they are all using relative addresses in their action lines, but I have a strange discrepancy I cannot figure out.
All of the forms have lines like this.
<form action="indexreport.cfm?fuseaction=casereport" etc. etc.
But one of them has to be coded like this.
<form action="/sales/indexreport.cfm?fuseaction=demoreport" etc. etc.
These forms are all on the same page. I cannot figure out why just this one particular form is needing the directory placed in front and the others are not. It is causing a problem because I tried to move everything to a new directory and now that one form is not working. The others still work.
Here is the whole page.
<cfquery datasource="#datasource#" name="staff">
SELECT *
FROM Staff
WHERE user_type = 2 OR user_type = 3
ORDER BY area, name_last, name_first
</cfquery>
<cfset alphalist = "A,B,C,D,E,F,G,H,Health,I,J,K,L,M,Memorial,N,O,P,Q,R,S,Select,St,T,U,V,W,X,Y,Z,1,2,3,4,5,6,7,8,9,0">
<script src="includes/lib/prototype.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function load_hospitals(letter){
document.getElementById('hospital_select').style.display = 'none';
var post_body = 'fuseaction=json_hospitals&hospital_letter='+ letter;
var url = 'indexreport.cfm';
new Ajax.Request(url, { parameters:post_body, onSuccess:hospital_handlerFunc, onFailure:errFunc})
}
var hospital_handlerFunc = function(t) {
document.getElementById('hospital_select').innerHTML = t.responseText;
document.getElementById('hospital_select').style.display = 'inline';
}
var errFunc = function(t) {
alert('Error ' + t.status + ' -- ' + t.statusText);
}
</script>
<br />
<table border="0" cellpadding="0" cellspacing="0" width="90%" align="center">
<form action="indexreport.cfm?fuseaction=act_demo_report" method="post" name="demo_form" id="demoForm">
<tr>
<td class="formtitle" colspan="10" style="height:18px;">Demo Report</td>
</tr>
<tr>
<td class="formlabel" width="150">Sales Person</td>
<td class="formfield">
<select name="staff_ID">
<option value="">All Staff</option>
<cfloop query="staff">
<cfoutput><option value="#staff.ID#" >#staff.name_last#, #staff.name_first# - #staff.area#</option></cfoutput>
</cfloop>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Sales Area</td>
<td class="formfield">
<select name="area">
<option value="" >All Areas</option>
<cfloop from="1" to="#arraylen(TERRITORIES)#" index="i">
<cfoutput><option value="#TERRITORIES[i]#" >#TERRITORIES[i]#</option></cfoutput>
</cfloop>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Surgeon Specialty</td>
<td class="formfield">
<select name="specialty">
<option value="">All Specialties</option>
<option value="Neuro">Neuro</option>
<option value="Ortho">Ortho</option>
<option value="Pain Mgnt">Pain Mgnt</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Discectomies</td>
<td class="formfield">
<select name="disectomies" >
<option value="" >Any Number</option>
<option value="0-4" >0-4</option>
<option value="5-9" >5-9</option>
<option value="10-14">10-14</option>
<option value="15-19">15-19</option>
<option value="20 or more">20 or more</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Location/Venue</td>
<td class="formfield">
<select name="location" >
<option value="" >All Locations</option>
<option value="Tradeshow" >Tradeshow-All</option>
<option value="National" >Tradeshow-National</option>
<option value="Local">Tradeshow-Local</option>
<option value="Other">Tradeshow-Other</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Product Demonstrated</td>
<td class="formfield">
<select name="product">
<option value="">All Demos</option>
<option value="Inclose">Inclose</option>
<option value="Xclose">Xclose</option>
<option value="Both">Both</option>
<option value="None">None</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Product Interest</td>
<td class="formfield">
<select name="product_interest">
<option value="">All Demos</option>
<option value="Inclose">Inclose</option>
<option value="Xclose">Xclose</option>
<option value="Both">Both</option>
<option value="None">None</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">NTC</td>
<td class="formfield">
<select name="ntc">
<option value="">Either</option>
<option value="true">Required</option>
<option value="false">Not Required</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Date of Demo (mm/dd/yyyy)</td>
<td class="formfield">
<label for="date_start">Start</label>
<input type="text" id="date_start1" name="date_start" value="<cfoutput>#dateformat(dateadd('m',-1,now()),'mm/dd/yyyy')#</cfoutput>" />
<!---<img src="/Scripts/img/cal.gif" width="16" height="16" border="0" onclick="popup1.setTarget(document.getElementById('date_start1'));" alt="Click Here to Pick up the date">--->
<label for="date_end">End</label>
<input type="text" id="date_end1" name="date_end" value="<cfoutput>#dateformat(now(),'mm/dd/yyyy')#</cfoutput>" />
<!---<img src="/Scripts/img/cal.gif" width="16" height="16" border="0" onclick="popup2.toggle();" alt="Click Here to Pick up the date">--->
</td>
</tr>
<tr>
<td class="formlabel"> </td>
<td class="formfield"><input type="submit" value="RUN" /></td>
</tr>
</form>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="90%" align="center">
<form action="/sales/indexreport.cfm?fuseaction=act_case_report" method="post" id="case_form" name="case_form">
<tr>
<td class="formtitle" colspan="2" style="height:18px;">Case Report</td>
</tr>
<tr>
<td class="formlabel" width="100">Sales Person</td>
<td class="formfield">
<select name="staff_ID">
<option value="">All Staff</option>
<cfloop query="staff">
<cfoutput><option value="#staff.ID#" >#staff.name_last#, #staff.name_first# - #staff.area#</option></cfoutput>
</cfloop>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Sales Area</td>
<td class="formfield">
<select name="area">
<option value="" >All Areas</option>
<cfloop from="1" to="#arraylen(TERRITORIES)#" index="i">
<cfoutput><option value="#TERRITORIES[i]#" >#TERRITORIES[i]#</option></cfoutput>
</cfloop>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Hospital</td>
<td class="formfield" colspan="3">
<input type="hidden" name="hospital_ID_holder" id="hospital_ID_holder" />
<select name="hospital_letter" onchange="load_hospitals(this.options[this.selectedIndex].value);">
<option value="">First Letter</option>
<cfloop list="#alphalist#" index="letter">
<cfoutput><option value="#letter#" >#letter#</option></cfoutput>
</cfloop>
<option value="">Full List</option>
</select>
<div id="hospital_select" style="display:inline;">
<select name="hospital_ID" onchange="$('hospital_ID_holder').value = this.options[this.selectedIndex].value;">
<option value="">All Hospitals</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="formlabel">Surgeon Specialty</td>
<td class="formfield">
<select name="specialty">
<option value="">All Specialties</option>
<option value="Neuro">Neuro</option>
<option value="Ortho">Ortho</option>
<option value="Pain Mgnt">Pain Mgnt</option>
</select>
</td>
</tr>
<!---<tr>
<td class="formlabel">Discectomies</td>
<td class="formfield">
<select name="disectomies" >
<option value="" >Any Number</option>
<option value="0-4" >0-4</option>
<option value="5-9" >5-9</option>
<option value="10-14">10-14</option>
<option value="15-19">15-19</option>
<option value="20 or more">20 or more</option>
</select>
</td>
</tr> --->
<tr>
<td class="formlabel">Product Used (Successful)</td>
<td class="formfield">
<select name="product">
<option value="">All Products</option>
<option value="Inclose">Inclose</option>
<option value="Xclose">Xclose</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Product Intended for Use (Unsuccessful)</td>
<td class="formfield">
<select name="product_intended">
<option value="">All Products</option>
<option value="Inclose">Inclose</option>
<option value="Xclose">Xclose</option>
<option value="Either">Either</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Successful</td>
<td class="formfield">
<select name="outcome_successful">
<option value="">Either</option>
<option value="true">Go</option>
<option value="false">No Go</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Was an Anulotomy Performed</td>
<td class="formfield">
<select name="anulotomy">
<option value="">All Options</option>
<option value="None">No Anulotomy Performed</option>
<option value="Slit" >Slit</option>
<option value="Box Window">Box Window</option>
<option value="Cruciate">Cruciate</option>
<option value="Other">Other</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Charge</td>
<td class="formfield">
<select name="charge">
<option value="">Either</option>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Patient Case Type</td>
<td class="formfield">
<select name="case_type">
<option value="">All Case Types</option>
<option value="1st Surgery">1st Surgery</option>
<option value="ReOp-Same Level and Site">ReOp-Same Level and Site</option>
<option value="ReOp-Different Level or Site">ReOp-Different Level or Site</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Date of Surgery (mm/dd/yyyy)</td>
<td class="formfield">
<!---Start<input type="text" name="date_start" value="<cfoutput>#dateformat(dateadd('m',-1,now()),'mm/dd/yyyy')#</cfoutput>" />
End<input type="text" name="date_end" value="<cfoutput>#dateformat(now(),'mm/dd/yyyy')#</cfoutput>" />--->
Start <input type="Text" name="date_start" value="<cfoutput>#dateformat(dateadd('m',-1,now()),'mm/dd/yyyy')#</cfoutput>">
<!---<a href="javascript:case_date_start.popup();"><img src="/Scripts/img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a>--->
End <input type="Text" name="date_end" value="<cfoutput>#dateformat(dateadd('m',0,now()),'mm/dd/yyyy')#</cfoutput>">
<!---<a href="javascript:case_date_start.popup();"><img src="/Scripts/img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a>--->
</td>
</tr>
<tr>
<td class="formlabel"> </td>
<td class="formfield"><input type="submit" value="RUN" /><input style="display:none;" type="button" name="btnCaseOrig" id="btnCaseOrig" onclick="setCaseActionOld();" value="Run Old" /></td>
</tr>
</form>
<script language="JavaScript">
<!-- // create calendar object(s) just after form tag closed
// specify form element as the only parameter (document.forms['formname'].elements['inputname']);
var case_date_start = new calendar2(document.forms['case_form'].elements['date_start']);
if(!case_date_start){ alert('here'); }
case_date_start.year_scroll = false;
case_date_start.time_comp = false;
var case_date_end = new calendar2(document.forms['case_form'].elements['date_end']);
case_date_end.year_scroll = false;
case_date_end.time_comp = false;
//-->
</script>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="90%" align="center">
<form action="indexreport.cfm?fuseaction=act_hospital_report" method="post">
<tr>
<td class="formtitle" colspan="10" style="height:18px;">Hospital Report</td>
</tr>
<tr>
<td class="formlabel" width="150">Sales Person</td>
<td class="formfield">
<select name="staff_ID">
<option value="">All Staff</option>
<cfloop query="staff">
<cfoutput><option value="#staff.ID#" >#staff.name_last#, #staff.name_first# - #staff.area#</option></cfoutput>
</cfloop>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Area</td>
<td class="formfield">
<select name="area">
<option value="" >All Areas</option>
<cfloop from="1" to="#arraylen(TERRITORIES)#" index="i">
<cfoutput><option value="#TERRITORIES[i]#" >#TERRITORIES[i]#</option></cfoutput>
</cfloop>
</select>
</td>
</tr>
<tr>
<td class="formlabel"> </td>
<td class="formfield"><input type="submit" value="RUN" /></td>
</tr>
</form>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="90%" align="center">
<form action="indexreport.cfm?fuseaction=act_surgeon_report" method="post">
<tr>
<td class="formtitle" colspan="10" style="height:18px;">Surgeon Report</td>
</tr>
<tr>
<td class="formlabel" width="150">Sales Person</td>
<td class="formfield">
<select name="staff_ID">
<option value="">All Staff</option>
<cfloop query="staff">
<cfoutput><option value="#staff.ID#" >#staff.name_last#, #staff.name_first# - #staff.area#</option></cfoutput>
</cfloop>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Area</td>
<td class="formfield">
<select name="area">
<option value="" >All Areas</option>
<cfloop from="1" to="#arraylen(TERRITORIES)#" index="i">
<cfoutput><option value="#TERRITORIES[i]#" >#TERRITORIES[i]#</option></cfoutput>
</cfloop>
</select>
</td>
</tr>
<tr>
<td class="formlabel">Specialty</td>
<td class="formfield">
<select name="specialty">
<option value="">All Specialties</option>
<option value="Neuro">Neuro</option>
<option value="Ortho">Ortho</option>
<option value="Pain Mgnt">Pain Mgnt</option>
</select>
</td>
</tr>
<tr>
<td class="formlabel"> </td>
<td class="formfield"><input type="submit" value="RUN" /></td>
</tr>
</form>
</table>