|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Select DOM Test</title>
<script type="text/javascript">
function node_delete(whichPara) {
if (confirm("Are you sure you want to delete this product?")) {
document.getElementById('allparas').removeChild(document.getElementById(whichPara));
}
}
function printDom() {
allHTML = document.getElementsByTagName("html")[0].innerHTML;
document.forms['update_table'].elements['dom'].value = allHTML;
}
var products_matrix = new Array();
products_matrix[0] = "";
products_matrix[1] = new Array("550|X1|product 1|10");
products_matrix[2] = new Array("551|Y1|Product in section 2|10", "552|Y2|Another Product in Section 2|10");
products_matrix[3] = new Array("640|B-682|Product in 3|1", "641|B-682-int|Another in 3|1", "642|CD-682|Product|1", "643|CD-6821|Another Product|1", "644|CD-C|And Another Product|1");
products_matrix[4] = new Array("611|E-API682sd|Item in section 4|15", "612|B-AP|Another item in section 4|15", "613|S2wed|item name here|20", "614|B-Chem|Another items|15", "615|B-Chem|and another|15", "616|B-C|Aargh|15", "624|B-Oi|Final test product|15");
var categories_names_array = new Array("Section 1", "Section 2", "Section 3", "Section 4");
var categories_ids_array = new Array("6", "7", "12", "9");
function updateproducts(selectedcategory, fieldtoupdate) {
alert("reached update products function");
var categorieslist = document.update_table.category1
var productslist = eval("document.forms['update_table'].elements['" + fieldtoupdate + "']")
productslist.options.length = 0
if (selectedcategory > 0) {
for (i = 0; i < products_matrix[selectedcategory].length; i++)
productslist.options[productslist.options.length] = new Option(products_matrix[selectedcategory][i].split("|")[1] + " - " + products_matrix[selectedcategory][i].split("|")[2], products_matrix[selectedcategory][i].split("|")[0]);
}
}
//-->
</script>
</head>
<body>
<form name="update_table" method="post" action="" enctype="multipart/form-data" style="padding:0px; margin:0px">
<p style="font-size:12px">Select Category:<br />
<select name="category1" onChange="updateproducts(this.selectedIndex,'product1')" />
<option value="">Select a category:</option>
<script language="Javascript">
for (p=0;p<categories_names_array.length;p++){
document.write("<option value=\"" + categories_ids_array[p] + "\">" + categories_names_array[p] + "</option>\n");
}
</script></select>
</p>
<p style="font-size:12px">Product Name: <select name="product1" style="font-size:13px">
<option value="" style="font-family:tahoma,arial,verdana,helvetica"> Please select a category first </option>
</select>
</p>
<div id="allparas">
<span class="order_button" style="margin-top:30px"><a style="font-weight:bold; clear:both; padding-top:10px; margin-top:10px;" href="#" onclick="
if( !document.createElement || !document.childNodes ) {
window.alert('Your browser is not DOM compliant');
} else {
// set up paragraph and select
randomNumber = Math.floor(Math.random()*9999999999999999)
var theNewParagraph = document.createElement('p');
var lineBreak = document.createElement('br');
var divName = 'div_' + randomNumber;
var theTopCategorySelect = document.createElement('select');
var theSelect = document.createElement('select');
newSelectName= 'select_' + document.getElementsByTagName('p').length;
newCatSelectName= 'select_category_' + randomNumber
myRandomNumber = Math.floor(Math.random()*9999999999999999);
newSelectName = newSelectName + myRandomNumber;
theSelect.setAttribute('name',newSelectName);
theSelect.setAttribute('style','font-size:13px;');
theTopCategorySelect.setAttribute('name',newCatSelectName);
theTopCategorySelect.setAttribute('style','font-size:13px');
passFunctionInSetAttr='updateproducts(this.selectedIndex,\'' + newSelectName + '\')';
alert(passFunctionInSetAttr);
theTopCategorySelect.setAttribute('onChange',passFunctionInSetAttr);
// set up options for select
firstOption = document.createElement('option');
firstOption.setAttribute('value','');
firstOption.setAttribute('style','font-weight:bold; font-size:12px');
firstText = document.createTextNode(' - ');
theSelect.appendChild(firstOption);
firstOption.appendChild(firstText);
arrayOptions=Array();
arrayText=Array();
// set up options for category select
catFirstOption = document.createElement('option');
catFirstOption,setAttribute('value','');
catFirstOption.setAttribute('style','font-weight:bold; font-size:12px');
catFirstText = document.createTextNode('Select A Category:');
theTopCategorySelect.appendChild(catFirstOption);
catFirstOption.appendChild(catFirstText);
arrayOptions=Array();
arrayText=Array();
for (p=0;p<categories_ids_array.length;p++){
arrayOptions[p] = document.createElement('option');
arrayOptions[p].setAttribute('value',categories_ids_array[p]);
arrayOptions[p].setAttribute('style','font-size:13px; ');
arrayText[p] = document.createTextNode(categories_names_array[p]);
theTopCategorySelect.appendChild(arrayOptions[p]);
arrayOptions[p].appendChild(arrayText[p]);
}
var theDeleteImage = document.createElement('img');
//set up theNewParagraph
newParaName= 'para_' + document.getElementsByTagName('p').length;
newParaName += randomNumber;
theNewParagraph.setAttribute('id',newParaName);
theNewParagraph.setAttribute('style','padding-top:10px; font-size:12px; clear:both;');
// delete image
theDeleteImage.setAttribute('src','http://www.dmlmarketing.net/demo/cancel.png');
deleteImageName = 'delete_' + document.getElementsByTagName('p').length;
deleteImageName += randomNumber;
theDeleteImage.setAttribute('id',deleteImageName);
theDeleteImage.setAttribute('hspace','20');
theDeleteImage.setAttribute('vspace','3');
// div
theDiv = document.createElement('div');
theDiv.setAttribute('id',divName);
theDiv.setAttribute('style','display:inline; float:left;');
//prepare the text nodes
var theText1 = document.createTextNode('Product Name:');
theCategoryText = document.createTextNode('Select Category:');
//put together the whole paragraph
theNewParagraph.appendChild(theCategoryText);
theNewParagraph.appendChild(lineBreak);
theNewParagraph.appendChild(theTopCategorySelect);
theNewParagraph.appendChild(lineBreak);
theNewParagraph.appendChild(theText1);
theNewParagraph.appendChild(theSelect);
theNewParagraph.appendChild(theDiv);
theDiv.appendChild(theDeleteImage);
//insert it into the document somewhere
this.parentNode.parentNode.insertBefore(theNewParagraph,this.parentNode);
//make the paragraph delete itself when the delete image is clicked
document.getElementById(deleteImageName).onclick = function () { node_delete(this.parentNode.parentNode.id); };
}
return false;">Add New</a></span>
<hr />
<span style="disaply:block; clear:both;"><textarea name="dom" rows=10 cols=70></textarea><br /><a href="Javascript:printDom()">Print Dom</a></span>
</form>
</body>
</html>
|
Advertisement
| Hall of Fame |