hows it going guys im having trouble modifing this search code to work for me. i got the function offline. bascially i need to add another text box but i need it hidden and i need to put a variable into it after the second select box is chosen.
thanks a lot in advance.
Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: Andrew (aberry@berrysystems.com) -->
<!-- Web Site: http://www.berrysystems.com -->
<!-- Begin -->
var arrItems1 = new Array();
var arrItemsGrp1 = new Array();
arrItems1[0] = "Site Templates";
arrItemsGrp1[0] = 1;
arrItems1[1] = "Site Collections";
arrItemsGrp1[1] = 1;
arrItems1[2] = "Web Parts";
arrItemsGrp1[2] = 1;
arrItems1[3] = "Site Security";
arrItemsGrp1[3] = 1;
arrItems1[4] = "Documents and Meetings Workspaces";
arrItemsGrp1[4] = 1;
arrItems1[5] = "Sub-sites";
arrItemsGrp1[5] = 1;
arrItems1[6] = "Anonymous Access";
arrItemsGrp1[6] = 2;
arrItems1[7] = "Permission Inheritance";
arrItemsGrp1[7] = 2;
arrItems1[8] = "Authenticated User Access";
arrItemsGrp1[8] = 2;
arrItems1[9] = "Item Level Access";
arrItemsGrp1[9] = 2;
arrItems1[10] = "Single Users";
arrItemsGrp1[10] = 3;
arrItems1[11] = "User Groups";
arrItemsGrp1[11] = 3;
arrItems1[12] = "Cross-site Groups";
arrItemsGrp1[12] = 3;
arrItems1[13] = "Add Delete View Alerts";
arrItemsGrp1[13] = 4;
arrItems1[14] = "Managing Alerts";
arrItemsGrp1[14] = 4;
arrItems1[15] = "Working with Templates";
arrItemsGrp1[15] = 5;
arrItems1[16] = "Content Approval";
arrItemsGrp1[16] = 5;
arrItems1[17] = "Creating Forms";
arrItemsGrp1[17] = 6;
arrItems1[18] = "Modifying Settings and Columns";
arrItemsGrp1[18] = 6;
arrItems1[19] = "Working with Views";
arrItemsGrp1[19] = 6;
arrItems1[20] = "Blocked File Types";
arrItemsGrp1[20] = 6;
arrItems1[21] = "Exporting and Importing";
arrItemsGrp1[21] = 6;
arrItems1[22] = "Working with Other Programs";
arrItemsGrp1[22] = 6;
arrItems1[23] = "Working with Documents";
arrItemsGrp1[23] = 7;
arrItems1[24] = "Working with Templates";
arrItemsGrp1[24] = 7;
arrItems1[25] = "Picture and Document Versioning";
arrItemsGrp1[25] = 7;
arrItems1[26] = "Content Approval";
arrItemsGrp1[26] = 7;
arrItems1[28] = "Modifying Settings and Columns";
arrItemsGrp1[28] = 8;
arrItems1[29] = "Enabling Email";
arrItemsGrp1[29] = 8;
arrItems1[30] = "Event Handlers";
arrItemsGrp1[30] = 8;
arrItems1[31] = "Filters";
arrItemsGrp1[31] = 8;
arrItems1[32] = "Explorer View";
arrItemsGrp1[32] = 8;
arrItems1[33] = "Personal and Shared Views";
arrItemsGrp1[33] = 9;
arrItems1[34] = "Working with Zones";
arrItemsGrp1[34] = 9;
arrItems1[35] = "Content Editor Web Part";
arrItemsGrp1[35] = 9;
arrItems1[36] = "Image Web Part";
arrItemsGrp1[36] = 9;
arrItems1[37] = "List View Web Part";
arrItemsGrp1[37] = 9;
arrItems1[38] = "XML Web Part";
arrItemsGrp1[38] = 9;
arrItems1[39] = "Web Part Galleries";
arrItemsGrp1[39] = 9;
arrItems1[40] = "Web Part Properties";
arrItemsGrp1[40] = 9;
arrItems1[41] = "Rights and Site Groups for Web Part Pages";
arrItemsGrp1[41] = 9;
arrItems1[42] = "Web Part Connections";
arrItemsGrp1[42] = 9;
arrItems1[43] = "Managing Permissions";
arrItemsGrp1[43] = 10;
arrItems1[44] = "Sorting and Filtering";
arrItemsGrp1[44] = 10;
arrItems1[45] = "Working with Views";
arrItemsGrp1[45] = 10;
arrItems1[46] = "Add Edit Delete Surveys";
arrItemsGrp1[46] = 11;
arrItems1[47] = "File Types";
arrItemsGrp1[47] = 11;
arrItems1[48] = "Preparing Images for Sharepoint";
arrItemsGrp1[48] = 11;
arrItems1[49] = "Editing Images";
arrItemsGrp1[49] = 11;
arrItems1[50] = "Explorer View";
arrItemsGrp1[50] = 12;
arrItems1[51] = "Modifying Settings and Columns";
arrItemsGrp1[51] = 12;
arrItems1[52] = "Working with Views";
arrItemsGrp1[52] = 12;
arrItems1[53] = "Working with Respondents";
arrItemsGrp1[53] = 12;
arrItems1[54] = "WebPart Page Templates";
arrItemsGrp1[54] = 13;
arrItems1[55] = "Modifying WebPart Pages";
arrItemsGrp1[55] = 13;
arrItems1[56] = "Web Part Maintenance Page";
arrItemsGrp1[56] = 13;
arrItems1[57] = "Excel";
arrItemsGrp1[57] = 14;
arrItems1[58] = "Word";
arrItemsGrp1[58] = 14;
arrItems1[59] = "Access";
arrItemsGrp1[59] = 14;
arrItems1[60] = "InfoPath";
arrItemsGrp1[60] = 14;
arrItems1[61] = "XP and Office2003";
arrItemsGrp1[61] = 14;
arrItems1[62] = "Working with Galleries";
arrItemsGrp1[62] = 15;
arrItems1[63] = "Members Web Part";
arrItemsGrp1[63] = 15;
arrItems1[64] = "Publishing Documents";
arrItemsGrp1[64] = 15;
arrItems1[65] = "Troubleshooting Documents";
arrItemsGrp1[65] = 15;
arrItems1[66] = "Working with Attendees and Users";
arrItemsGrp1[66] = 16;
arrItems1[67] = "Working with Pages";
arrItemsGrp1[67] = 16;
arrItems1[68] = "Working with Meeting Details";
arrItemsGrp1[68] = 16;
arrItems1[69] = "Working with Search";
arrItemsGrp1[69] = 17;
arrItems1[70] = "New Site Requests";
arrItemsGrp1[70] = 17;
arrItems1[71] = "Additional Space Requests";
arrItemsGrp1[71] = 17;
function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
//if (control.name == "firstChoice") {
// Empty the third drop down box of any choices
// for (var q=myChoices.thirdChoice.options.length;q>=0;q--) myChoices.thirdChoice.options[q] = null;
//}
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[SELECT]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
//myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>
<table align="center" width="100%" cellpadding="5" cellspacing="0" border="0" bgcolor="#D8E0EC">
<tr>
<td>
<b>Step 1: Select FAQ Category:</b><br><br>
<SELECT id="firstChoice" name="firstChoice" onchange="selectChange(this, secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Managing Team Sites</option>
<option value=2>Managing Permissions</option>
<option value=3>Managing Users and Groups</option>
<option value=4>Working with Alerts</option>
<option value=5>Managing Lists</option>
<option value=6>Working with Lists</option>
<option value=7>Managing Libraries</option>
<option value=8>Working with Libraries</option>
<option value=9>Working with Web Parts</option>
<option value=10>Working with Discussion Boards</option>
<option value=11>Working with Surveys</option>
<option value=12>Working with Images</option>
<option value=13>Working with WebPart Pages</option>
<option value=14>Working with Other Programs</option>
<option value=15>Document Workspaces</option>
<option value=16>Meeting Workspaces</option>
<option value=17>Miscellaneous</option>
</SELECT>
</TD>
</TR>
<TR valign="middle">
<TD>
<b>Step 2: Select FAQ Subcategory:</b><br><br>
<div onkeydown="javascript:if (event.keyCode == 13) _SFSUBMIT_">
<SELECT id="secondChoice" name="secondChoice">
</SELECT><br><br><input type=hidden name="thirdChoice">
<b>Step 3: Select "SEARCH"!</b><br><br><input type="button" value="Search" onclick="javascript:_SFSUBMIT_"/></div>
</TD>
</TR>
</TABLE>
<!-- Script Size: 3.92 KB -->
all i need is to create another text box and put the variable x into it, please help.