shawntbanks
Programmer
hi there, I am relitively new to coldfusion and Javascript, so i am looking for a little help regarding dropdown menues. I seem to have no problem populating them from scratch, but when I recall what a person has selected, and put that in as the selection that shows, and then give them the option to change it, that is where I am running into problems, I cant seem to get the subcategory field to work with the category. Maybe someone has a better solution than what I am using, maybe I am going about it all the wrong way. Please help
Thanks
<cfset idx = -1>
<cfset mycase = 0>
<head>
<title>Online Shopping Centre</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
// BannerAD
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
<cfinclude template = "banneradssecondlevel_dirs.cfm">
var preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages=new Image();
preloadedimages.src=bannerAD;
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 10000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#"!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
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; return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
function whichLocal(obj){
switch (obj.select_Ad_Subcategory.selectedIndex){
<!--- use the group attribute to group output by category --->
<cfoutput query="get_SubCategories" group="Category">
<cfset mycase = mycase + 1>case #mycase#:
<cfset myList = ValueList(get_SubCategories.categoryid)>
<cfset numberInCategory = ListValueCount(myList, categoryid)>
obj.selectLocal.length=#numberInCategory#<cfoutput><cfset idx = idx + 1>
obj.selectLocal.options[#idx#].value="#get_SubCategories.subcategoryid#"
obj.selectLocal.options[#idx#].text="#trim(get_SubCategories.SubCategory)#"</cfoutput>
break;
<cfset idx = -1>
</cfoutput>
}
}
</script>
</head>
<center>
<body bgcolor=7B755A link="7B755A" vlink="339933" alink="A8A586" onLoad="MM_preloadImages('../images/Vehicle_on.jpg','../images/Real_Estate_on.jpg')">
<table width="760" border="0" cellspacing="0" cellpadding="0">
<!--- Top table begins here --------------------------------------------------------------------------->
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><img src="../images/market_logo.gif"></td>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="A6A586">
<tr>
<td colspan="3"><img src="../images/top_space.gif"></td>
</tr>
<tr height="60">
<td><a href="javascript:jump2url()" onMouseOver="displayStatusMsg();return document.returnValue"><img src="../images/image1.gif" name="bannerADrotator" style="filter:revealTrans(duration=2,transition=20)" border=0></a>
<script language="JavaScript">nextAd()</script></td>
</tr>
<tr>
<cfif Not isdefined ("browser"><td colspan="3"><img src="../images/bottom_spacer2.gif"></td><cfelse><td colspan="3"><img src="../images/bottom_spacer.gif"></td></cfif>
</tr>
</table>
</td>
<td align="top"><img src="../images/town_logo.gif"></td>
</table>
<!--- Top table ends here -------------------------------------------------------------------------->
<td width="760"></td></tr>
<tr><td align="top"><table border="0" cellpadding="0" cellspacing="0" width="760">
<tr>
<td width="158" valign="top" background="../images/top_space2.gif">
<img src="../images/top_space2.gif"><br>
<img src="../images/contents.gif"><br>
<a href="../home.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image36','','../Images/home_on.gif',1)"><img border=0 src="../images/home.gif" name="Image36"></a><br>
<a href="../place_ad.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image37','','../Images/placeanad_on.gif',1)"><img border=0 src="../images/placeanad.gif" name="Image37"></a><br>
<a href="../Registration.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image38','','../Images/register_on.gif',1)"><img border=0 src="../images/register.gif" name="Image38"></a><br>
<a href="../Services_and_howto.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image39','','../Images/Contents_services_on.gif',1)"><img border=0 src="../images/Contents_Services.gif" name="Image39"></a><br>
<a href="../FAQ.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image40','','../Images/faq_on.gif',1)"><img border=0 src="../images/faq.gif" name="Image40"></a><br>
<a href="../Contact_Us.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','../Images/contact_on.gif',1)"><img border=0 src="../images/contact.gif" name="Image41"></a><br>
<img src="../images/categories.gif"><br>
<a href="../Ad_Drill_Down.cfm?id=2" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image28','','../images/Vehicle_on.gif',1)"><img src="../images/Vehicles.gif" name="Image28" width="158" height="17" border="0"></a><br>
<a href="../Ad_Drill_Down.cfm?id=3" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image35','','../images/RealEstate_on.gif',1)"><img src="../images/realestate.gif" name="Image35" width="158" height="16" border="0"></a><br>
<a href="../Ad_Drill_Down.cfm?id=14" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image30','','../images/rentals_on.gif',1)"><img border=0 src="../images/rentals.gif" name="Image30" width="158" height="16"></a><br>
<a href="../Ad_Drill_Down.cfm?id=15" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image31','','../images/Merchandise_on.gif',1)"><img border=0 src="../images/merchandise.gif" name="Image31" width="158" height="16"></a><br>
<a href="../Ad_Drill_Down.cfm?id=1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image32','','../images/Electronics_on.gif',1)"><img border=0 src="../images/electronics.gif" name="Image32" width="158" height="17"></a><br>
<a href="../Ad_Drill_Down.cfm?id=16" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image33','','../images/Services_on.gif',1)"><img border=0 src="../images/services.gif" name="Image33" width="158" height="17"></a><br>
<a href="../Ad_Drill_Down.cfm?id=17" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image34','','../images/Equipment_on.gif',1)"><img border=0 src="../images/equipment.gif" name="Image34" width="158" height="17"></a><br>
<img src="../images/dot_space.gif">
<table>
<!--- <img src="../Images/search.gif"> --->
<tr><td><div align="center"><font face="Georgia, Times New Roman, Times, serif"><strong>Advanced<br>
Search</strong></font></div></td></tr>
<tr>
<td valign="middle" height="50">
<cfform action="../cat_Search.cfm" method="post">
<cfinput size="15" type="text" name="Item_Name">
<input name="Submit" type="image" src="../images/go.gif" alt="Search" align="bottom">
</cfform></td></tr></table>
</td>
Page 2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<cfquery name="get_Communities" datasource="Market">
SELECT *
FROM Communities
order by location
</cfquery>
<cfquery name="get_SubCategories" datasource="Market">
SELECT Category, categoryid, subcategory, subcategoryid
FROM subandcat
</cfquery>
<cfinclude template="../Templates/Header_&_Sidebar_for_Place_Ad_Folder_Subcat_Select.cfm">
<td width="603" rowspan="2" valign="top" bgcolor="#FFFFFF">
<CFIF IsDefined("FORM.edititemnum">
<CFLOCK timeout="30"
throwontimeout="no"
type="exclusive"
scope="session">
<CFSET SESSION.cart[#FORM.edititemnum#].itemname = FORM.itemname>
<CFSET SESSION.cart[#FORM.edititemnum#].categoryid = FORM.select_Ad_Subcategory>
<CFSET SESSION.cart[#FORM.edititemnum#].subcategoryid = FORM.selectLocal>
<CFSET SESSION.cart[#FORM.edititemnum#].location = FORM.Community_List>
<CFSET SESSION.cart[#FORM.edititemnum#].Short_Description = FORM.Short_Description>
<CFSET SESSION.cart[#FORM.edititemnum#].long_description = FORM.long_description>
<CFSET SESSION.cart[#FORM.edititemnum#].itemprice = FORM.itemprice>
<CFSET SESSION.cart[#FORM.edititemnum#].featured = FORM.featured>
<CFSET SESSION.cart[#FORM.edititemnum#].begindate = FORM.begindate>
<CFSET SESSION.cart[#FORM.edititemnum#].enddate = FORM.begindate + FORM.enddate>
</CFLOCK>
<!--- maybe to a CFLOCATION back to page3 here, if you want --->
<cflocation url="step3.cfm">
<CFELSE>
<CFSET strEditItem = StructNew()>
<CFLOCK timeout="30"
throwontimeout="no"
type="readonly"
scope="session">
<CFSET strEditItem = SESSION.cart[#URL.itemnum#]>
</CFLOCK>
<!---<cfif isdefined ("url.itemnum"></cfif> --->
<cfquery name="get_cat" datasource="Market">
SELECT Category, categoryid, subcategory, subcategoryid
FROM subandcat
where subcategoryid = #SESSION.cart[URL.itemnum].subcategoryid#
</cfquery>
<cfquery name="get_subcat2" datasource="Market">
SELECT Category, categoryid, subcategory, subcategoryid
FROM subandcat
where categoryid = #get_cat.categoryid#
</cfquery>
<cfform action="edit_item.cfm" method="post" enctype="multipart/form-data">
<table align="center" border="0">
<tr>
<td colspan="5" class="FormHeaders"><div align="center"><font size="4" face="Georgia, Times New Roman, Times, serif"><!--- <cfoutput>#categories.Category#</cfoutput> --->
Details</font></div></td>
</tr>
<tr bgcolor="#EDECE0"><td><font face="Georgia, Times New Roman, Times, serif">Category:</font></td>
<td valign="top" colspan="4">
<!---<select name="select_Ad_Subcategory" onchange="whichLocal(this.form)" size="1">
<cfoutput><option value="#get_cat.categoryid#">#get_cat.category#</option></cfoutput>
again, use the group attribute to group output by category
<cfoutput query="get_SubCategories" group="Category">
<option value="#Categoryid#">#Category#</option>
</cfoutput>
<cfoutput query="get_SubCategories" group="Category">
<option value="#Categoryid#" <cfif get_cat.categoryid eq get_subCategories.categoryid> selected</cfif>>#Category#</option>
</cfoutput>
</select>--->
<select name="select_Ad_Subcategory" onchange="whichLocal(this.form)" size="1">
<cfoutput query="get_SubCategories" group="Category">
<option value="#Categoryid#" <cfif get_cat.categoryid eq get_subCategories.categoryid> selected</cfif>>#Category#</option>
</cfoutput>
</select>
</td></tr>
<tr><td><font face="Georgia, Times New Roman, Times, serif">Subcategory:</font></td>
<td colspan="4"> <!--- <select name="selectLocal" onChange="whichLocal(this.form)" size="1">
<cfoutput><option value="#get_cat.subcategoryid#">#get_cat.subcategory#</option></cfoutput>
<cfoutput query="get_subcat2"><option value="#subcategory#">#subcategory#</option></cfoutput> --->
<select name="selectLocal" onChange="whichLocal(this.form)" size="1">
<cfoutput query="get_subcat2"><option value="#subcategory#" <cfif get_cat.subcategoryid eq get_subcat2.subcategoryid>selected</cfif>>#subcategory#</option></cfoutput>
</select>
<!---<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</select>---></td>
</tr>
<tr bgcolor="#EDECE0">
<td><font face="Georgia, Times New Roman, Times, serif">Community:</font></td>
<td colspan="4"><font face="Georgia, Times New Roman, Times, serif">
<select name="Community_List">
<option><cfoutput>#strEditItem.location#</cfoutput></option>
<cfoutput query="Get_Communities">
<option value="#location#">#location#</option>
</cfoutput>
</select>
</font></td>
</tr>
<tr>
<td width="109" ><font face="Georgia, Times New Roman, Times, serif">Item
Name:</font></td>
<td colspan="4"> <font face="Georgia, Times New Roman, Times, serif">
<CFinput name="Itemname" type="text" required="no" message="Item Name Required" value="#strEditItem.itemname#">
</font></td>
</tr>
<tr bgcolor="#EDECE0">
<td valign="top" ><font face="Georgia, Times New Roman, Times, serif">Short
Description:</font></td>
<td colspan="4">
<textarea name="Short_description" cols="30" rows="5" wrap="hard" onChange="if (this.value.length > 100) {alert('The Short Description Cannot Be Greater Than 100 Chars.')};"><cfoutput>#strEditItem.short_description#</cfoutput></textarea>
</td>
</tr>
<tr>
<td valign="top" ><font face="Georgia, Times New Roman, Times, serif">Long
Description:</font></td>
<td colspan="4"><textarea name="Long_description" cols="30" rows="5"><cfoutput>#strEditItem.long_description#</cfoutput></textarea>
</td>
</tr>
<tr bgcolor="#EDECE0">
<td><font face="Georgia, Times New Roman, Times, serif">Asking
Price:</font></td>
<td colspan="4"><CFinput name="itemprice" value="#strEditItem.itemprice#" type="text" id="itemprice" required="no" message="Asking Price Required" size="20" maxlength="9">
</td>
</tr>
<tr>
<td valign="top"><font face="Georgia, Times New Roman, Times, serif"><span >Featured
Item</span><font color="#FF0000">*</font></font></td>
<td colspan="4"> <cfif strEditItem.Featured EQ 1><CFinput name="featured" type="radio" id="featured" value="1"checked="yes"> <cfelse><CFinput name="featured" type="radio" id="featured" value="1"></cfif>
<font size="-2" face="Georgia, Times New Roman, Times, serif">Yes</font> </td>
<tr><td> </td><td colspan="4"> <cfif strEditItem.Featured EQ 0><CFinput name="featured" type="radio" id="featured" value="0" checked="yes"> <cfelse><CFinput name="featured" type="radio" id="featured" value="0"></cfif>
<font size="-2" face="Georgia, Times New Roman, Times, serif">No</font> </td></tr>
</tr>
<tr bgcolor="#EDECE0">
<td><font face="Georgia, Times New Roman, Times, serif">Start
Date Of Ad:</font></td>
<td colspan="4"><cfinput name="begindate" type="text" validate="date" value="#strEditItem.begindate#">
</td>
</tr>
<tr>
<td valign="top"><font face="Georgia, Times New Roman, Times, serif">Length
Of Ad:</font></td>
<td><cfif strEditItem.Enddate EQ strEditItem.begindate + 7><CFinput name="Enddate" type="radio" value="7" checked="yes"><cfelse><CFinput name="Enddate" type="radio" value="7"></cfif></td>
<td><font face="Georgia, Times New Roman, Times, serif">7
Days</font></td>
<tr bgcolor="#EDECE0">
<td><font face="Georgia, Times New Roman, Times, serif"> </font></td>
<td><cfif strEditItem.Enddate EQ strEditItem.begindate + 30><CFinput name="Enddate" type="radio" value="30" checked="yes"><cfelse><CFinput name="Enddate" type="radio" value="30"></cfif></td>
<td><font face="Georgia, Times New Roman, Times, serif">30 Days
</font></td>
</tr></table>
<table align="center" border="0">
<tr bgcolor="#FFFFFF">
<td colspan="5"><div align="center"> <CFOUTPUT><input type="hidden" name="edititemnum" value="#URL.itemnum#"></CFOUTPUT>
<input type="submit" value="Continue >>">
</div></td>
</tr>
</table>
</cfform>
</CFIF>
<tr>
<td background="../images/top_space2.gif"><img src="../images/top_space2.gif"></td>
</tr>
</table>
</td></tr>
</table>
</body>
</html>
Thanks
<cfset idx = -1>
<cfset mycase = 0>
<head>
<title>Online Shopping Centre</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
// BannerAD
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
<cfinclude template = "banneradssecondlevel_dirs.cfm">
var preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages=new Image();
preloadedimages.src=bannerAD;
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 10000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#"!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
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; return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
function whichLocal(obj){
switch (obj.select_Ad_Subcategory.selectedIndex){
<!--- use the group attribute to group output by category --->
<cfoutput query="get_SubCategories" group="Category">
<cfset mycase = mycase + 1>case #mycase#:
<cfset myList = ValueList(get_SubCategories.categoryid)>
<cfset numberInCategory = ListValueCount(myList, categoryid)>
obj.selectLocal.length=#numberInCategory#<cfoutput><cfset idx = idx + 1>
obj.selectLocal.options[#idx#].value="#get_SubCategories.subcategoryid#"
obj.selectLocal.options[#idx#].text="#trim(get_SubCategories.SubCategory)#"</cfoutput>
break;
<cfset idx = -1>
</cfoutput>
}
}
</script>
</head>
<center>
<body bgcolor=7B755A link="7B755A" vlink="339933" alink="A8A586" onLoad="MM_preloadImages('../images/Vehicle_on.jpg','../images/Real_Estate_on.jpg')">
<table width="760" border="0" cellspacing="0" cellpadding="0">
<!--- Top table begins here --------------------------------------------------------------------------->
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><img src="../images/market_logo.gif"></td>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="A6A586">
<tr>
<td colspan="3"><img src="../images/top_space.gif"></td>
</tr>
<tr height="60">
<td><a href="javascript:jump2url()" onMouseOver="displayStatusMsg();return document.returnValue"><img src="../images/image1.gif" name="bannerADrotator" style="filter:revealTrans(duration=2,transition=20)" border=0></a>
<script language="JavaScript">nextAd()</script></td>
</tr>
<tr>
<cfif Not isdefined ("browser"><td colspan="3"><img src="../images/bottom_spacer2.gif"></td><cfelse><td colspan="3"><img src="../images/bottom_spacer.gif"></td></cfif>
</tr>
</table>
</td>
<td align="top"><img src="../images/town_logo.gif"></td>
</table>
<!--- Top table ends here -------------------------------------------------------------------------->
<td width="760"></td></tr>
<tr><td align="top"><table border="0" cellpadding="0" cellspacing="0" width="760">
<tr>
<td width="158" valign="top" background="../images/top_space2.gif">
<img src="../images/top_space2.gif"><br>
<img src="../images/contents.gif"><br>
<a href="../home.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image36','','../Images/home_on.gif',1)"><img border=0 src="../images/home.gif" name="Image36"></a><br>
<a href="../place_ad.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image37','','../Images/placeanad_on.gif',1)"><img border=0 src="../images/placeanad.gif" name="Image37"></a><br>
<a href="../Registration.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image38','','../Images/register_on.gif',1)"><img border=0 src="../images/register.gif" name="Image38"></a><br>
<a href="../Services_and_howto.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image39','','../Images/Contents_services_on.gif',1)"><img border=0 src="../images/Contents_Services.gif" name="Image39"></a><br>
<a href="../FAQ.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image40','','../Images/faq_on.gif',1)"><img border=0 src="../images/faq.gif" name="Image40"></a><br>
<a href="../Contact_Us.cfm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','../Images/contact_on.gif',1)"><img border=0 src="../images/contact.gif" name="Image41"></a><br>
<img src="../images/categories.gif"><br>
<a href="../Ad_Drill_Down.cfm?id=2" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image28','','../images/Vehicle_on.gif',1)"><img src="../images/Vehicles.gif" name="Image28" width="158" height="17" border="0"></a><br>
<a href="../Ad_Drill_Down.cfm?id=3" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image35','','../images/RealEstate_on.gif',1)"><img src="../images/realestate.gif" name="Image35" width="158" height="16" border="0"></a><br>
<a href="../Ad_Drill_Down.cfm?id=14" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image30','','../images/rentals_on.gif',1)"><img border=0 src="../images/rentals.gif" name="Image30" width="158" height="16"></a><br>
<a href="../Ad_Drill_Down.cfm?id=15" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image31','','../images/Merchandise_on.gif',1)"><img border=0 src="../images/merchandise.gif" name="Image31" width="158" height="16"></a><br>
<a href="../Ad_Drill_Down.cfm?id=1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image32','','../images/Electronics_on.gif',1)"><img border=0 src="../images/electronics.gif" name="Image32" width="158" height="17"></a><br>
<a href="../Ad_Drill_Down.cfm?id=16" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image33','','../images/Services_on.gif',1)"><img border=0 src="../images/services.gif" name="Image33" width="158" height="17"></a><br>
<a href="../Ad_Drill_Down.cfm?id=17" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image34','','../images/Equipment_on.gif',1)"><img border=0 src="../images/equipment.gif" name="Image34" width="158" height="17"></a><br>
<img src="../images/dot_space.gif">
<table>
<!--- <img src="../Images/search.gif"> --->
<tr><td><div align="center"><font face="Georgia, Times New Roman, Times, serif"><strong>Advanced<br>
Search</strong></font></div></td></tr>
<tr>
<td valign="middle" height="50">
<cfform action="../cat_Search.cfm" method="post">
<cfinput size="15" type="text" name="Item_Name">
<input name="Submit" type="image" src="../images/go.gif" alt="Search" align="bottom">
</cfform></td></tr></table>
</td>
Page 2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<cfquery name="get_Communities" datasource="Market">
SELECT *
FROM Communities
order by location
</cfquery>
<cfquery name="get_SubCategories" datasource="Market">
SELECT Category, categoryid, subcategory, subcategoryid
FROM subandcat
</cfquery>
<cfinclude template="../Templates/Header_&_Sidebar_for_Place_Ad_Folder_Subcat_Select.cfm">
<td width="603" rowspan="2" valign="top" bgcolor="#FFFFFF">
<CFIF IsDefined("FORM.edititemnum">
<CFLOCK timeout="30"
throwontimeout="no"
type="exclusive"
scope="session">
<CFSET SESSION.cart[#FORM.edititemnum#].itemname = FORM.itemname>
<CFSET SESSION.cart[#FORM.edititemnum#].categoryid = FORM.select_Ad_Subcategory>
<CFSET SESSION.cart[#FORM.edititemnum#].subcategoryid = FORM.selectLocal>
<CFSET SESSION.cart[#FORM.edititemnum#].location = FORM.Community_List>
<CFSET SESSION.cart[#FORM.edititemnum#].Short_Description = FORM.Short_Description>
<CFSET SESSION.cart[#FORM.edititemnum#].long_description = FORM.long_description>
<CFSET SESSION.cart[#FORM.edititemnum#].itemprice = FORM.itemprice>
<CFSET SESSION.cart[#FORM.edititemnum#].featured = FORM.featured>
<CFSET SESSION.cart[#FORM.edititemnum#].begindate = FORM.begindate>
<CFSET SESSION.cart[#FORM.edititemnum#].enddate = FORM.begindate + FORM.enddate>
</CFLOCK>
<!--- maybe to a CFLOCATION back to page3 here, if you want --->
<cflocation url="step3.cfm">
<CFELSE>
<CFSET strEditItem = StructNew()>
<CFLOCK timeout="30"
throwontimeout="no"
type="readonly"
scope="session">
<CFSET strEditItem = SESSION.cart[#URL.itemnum#]>
</CFLOCK>
<!---<cfif isdefined ("url.itemnum"></cfif> --->
<cfquery name="get_cat" datasource="Market">
SELECT Category, categoryid, subcategory, subcategoryid
FROM subandcat
where subcategoryid = #SESSION.cart[URL.itemnum].subcategoryid#
</cfquery>
<cfquery name="get_subcat2" datasource="Market">
SELECT Category, categoryid, subcategory, subcategoryid
FROM subandcat
where categoryid = #get_cat.categoryid#
</cfquery>
<cfform action="edit_item.cfm" method="post" enctype="multipart/form-data">
<table align="center" border="0">
<tr>
<td colspan="5" class="FormHeaders"><div align="center"><font size="4" face="Georgia, Times New Roman, Times, serif"><!--- <cfoutput>#categories.Category#</cfoutput> --->
Details</font></div></td>
</tr>
<tr bgcolor="#EDECE0"><td><font face="Georgia, Times New Roman, Times, serif">Category:</font></td>
<td valign="top" colspan="4">
<!---<select name="select_Ad_Subcategory" onchange="whichLocal(this.form)" size="1">
<cfoutput><option value="#get_cat.categoryid#">#get_cat.category#</option></cfoutput>
again, use the group attribute to group output by category
<cfoutput query="get_SubCategories" group="Category">
<option value="#Categoryid#">#Category#</option>
</cfoutput>
<cfoutput query="get_SubCategories" group="Category">
<option value="#Categoryid#" <cfif get_cat.categoryid eq get_subCategories.categoryid> selected</cfif>>#Category#</option>
</cfoutput>
</select>--->
<select name="select_Ad_Subcategory" onchange="whichLocal(this.form)" size="1">
<cfoutput query="get_SubCategories" group="Category">
<option value="#Categoryid#" <cfif get_cat.categoryid eq get_subCategories.categoryid> selected</cfif>>#Category#</option>
</cfoutput>
</select>
</td></tr>
<tr><td><font face="Georgia, Times New Roman, Times, serif">Subcategory:</font></td>
<td colspan="4"> <!--- <select name="selectLocal" onChange="whichLocal(this.form)" size="1">
<cfoutput><option value="#get_cat.subcategoryid#">#get_cat.subcategory#</option></cfoutput>
<cfoutput query="get_subcat2"><option value="#subcategory#">#subcategory#</option></cfoutput> --->
<select name="selectLocal" onChange="whichLocal(this.form)" size="1">
<cfoutput query="get_subcat2"><option value="#subcategory#" <cfif get_cat.subcategoryid eq get_subcat2.subcategoryid>selected</cfif>>#subcategory#</option></cfoutput>
</select>
<!---<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</select>---></td>
</tr>
<tr bgcolor="#EDECE0">
<td><font face="Georgia, Times New Roman, Times, serif">Community:</font></td>
<td colspan="4"><font face="Georgia, Times New Roman, Times, serif">
<select name="Community_List">
<option><cfoutput>#strEditItem.location#</cfoutput></option>
<cfoutput query="Get_Communities">
<option value="#location#">#location#</option>
</cfoutput>
</select>
</font></td>
</tr>
<tr>
<td width="109" ><font face="Georgia, Times New Roman, Times, serif">Item
Name:</font></td>
<td colspan="4"> <font face="Georgia, Times New Roman, Times, serif">
<CFinput name="Itemname" type="text" required="no" message="Item Name Required" value="#strEditItem.itemname#">
</font></td>
</tr>
<tr bgcolor="#EDECE0">
<td valign="top" ><font face="Georgia, Times New Roman, Times, serif">Short
Description:</font></td>
<td colspan="4">
<textarea name="Short_description" cols="30" rows="5" wrap="hard" onChange="if (this.value.length > 100) {alert('The Short Description Cannot Be Greater Than 100 Chars.')};"><cfoutput>#strEditItem.short_description#</cfoutput></textarea>
</td>
</tr>
<tr>
<td valign="top" ><font face="Georgia, Times New Roman, Times, serif">Long
Description:</font></td>
<td colspan="4"><textarea name="Long_description" cols="30" rows="5"><cfoutput>#strEditItem.long_description#</cfoutput></textarea>
</td>
</tr>
<tr bgcolor="#EDECE0">
<td><font face="Georgia, Times New Roman, Times, serif">Asking
Price:</font></td>
<td colspan="4"><CFinput name="itemprice" value="#strEditItem.itemprice#" type="text" id="itemprice" required="no" message="Asking Price Required" size="20" maxlength="9">
</td>
</tr>
<tr>
<td valign="top"><font face="Georgia, Times New Roman, Times, serif"><span >Featured
Item</span><font color="#FF0000">*</font></font></td>
<td colspan="4"> <cfif strEditItem.Featured EQ 1><CFinput name="featured" type="radio" id="featured" value="1"checked="yes"> <cfelse><CFinput name="featured" type="radio" id="featured" value="1"></cfif>
<font size="-2" face="Georgia, Times New Roman, Times, serif">Yes</font> </td>
<tr><td> </td><td colspan="4"> <cfif strEditItem.Featured EQ 0><CFinput name="featured" type="radio" id="featured" value="0" checked="yes"> <cfelse><CFinput name="featured" type="radio" id="featured" value="0"></cfif>
<font size="-2" face="Georgia, Times New Roman, Times, serif">No</font> </td></tr>
</tr>
<tr bgcolor="#EDECE0">
<td><font face="Georgia, Times New Roman, Times, serif">Start
Date Of Ad:</font></td>
<td colspan="4"><cfinput name="begindate" type="text" validate="date" value="#strEditItem.begindate#">
</td>
</tr>
<tr>
<td valign="top"><font face="Georgia, Times New Roman, Times, serif">Length
Of Ad:</font></td>
<td><cfif strEditItem.Enddate EQ strEditItem.begindate + 7><CFinput name="Enddate" type="radio" value="7" checked="yes"><cfelse><CFinput name="Enddate" type="radio" value="7"></cfif></td>
<td><font face="Georgia, Times New Roman, Times, serif">7
Days</font></td>
<tr bgcolor="#EDECE0">
<td><font face="Georgia, Times New Roman, Times, serif"> </font></td>
<td><cfif strEditItem.Enddate EQ strEditItem.begindate + 30><CFinput name="Enddate" type="radio" value="30" checked="yes"><cfelse><CFinput name="Enddate" type="radio" value="30"></cfif></td>
<td><font face="Georgia, Times New Roman, Times, serif">30 Days
</font></td>
</tr></table>
<table align="center" border="0">
<tr bgcolor="#FFFFFF">
<td colspan="5"><div align="center"> <CFOUTPUT><input type="hidden" name="edititemnum" value="#URL.itemnum#"></CFOUTPUT>
<input type="submit" value="Continue >>">
</div></td>
</tr>
</table>
</cfform>
</CFIF>
<tr>
<td background="../images/top_space2.gif"><img src="../images/top_space2.gif"></td>
</tr>
</table>
</td></tr>
</table>
</body>
</html>