I have used drag and drop functionality i.e drag and drop values from one select box to other and viceversa. Initially one select box contains elements. we have to drag and drop the values from the select box to other select boxes and viceversa. The problem is: when we drag and drop the values to the empty select box. i am not able to get the options for that select box. when i click on viewsource, the options which i have dropped is not exist in the select box. Please solve this problem. i need this quickly.
On Jun 15, 3:51 pm, firoz...@gmail.com wrote: > I have used drag and drop functionality i.e drag and drop values from > one select box to other and viceversa. > Initially one select box contains elements. we have to drag and drop > the values from the select box to other select boxes and viceversa. > > The problem is: > when we drag and drop the values to the empty select box. i am not > able to get the options for that select box. when i click on > viewsource, the options which i have dropped is not exist in the > select box. > > Please solve this problem. i need this quickly. The souce code is like this <script language="javascript"> var d; function drag(objSource) { this.select = objSource; } function drag.prototype.drop() { var obj1 = whichElement(event); if (!this.dragStart) return; this.dest = document.getElementById(obj1); if(this.dest == null) return; var o = this.option.cloneNode(true); this.dest.appendChild(o); this.select.removeChild(this.option); return true; } function drag.prototype.setIndex() { var i = this.select.selectedIndex; //i returns -1 if no option is "truly" selected window.status="selectedIndex = "; if (i==-1) { return; } this.option = this.select.options[i]; this.dragStart=true; } function whichElement(e) { var targ; if (!e) { var e = window.event; } if (e.target) { targ = e.target; } else if (e.srcElement) { targ = e.srcElement; } if (targ.nodeType == 3) // defeat Safari bug { targ = targ.parentNode; } var tname; tname=targ.tagName; var attrName = targ.id; if(tname == "SELECT") return attrName; } </script> <body> <select name="one" id="one" onmousedown="d = new drag(this);" onmouseup="d.drop();" onmouseout="if (typeof d != 'undefined') { d.setIndex();}" size="28" style="width:140px" class="text"> <option>Fname</option> <option>Email</option> <option>Lname</option> <option>City</option> <option>State</option> </select > <select name="two" id="two" onmousedown="d = new drag(this);" onmouseup="d.drop();" onmouseout="if (typeof d != 'undefined') { d.setIndex();}" size="28" style="width:140px" class="text"> </select > <select name="three" id="three" onmousedown="d = new drag(this);" onmouseup="d.drop();" onmouseout="if (typeof d != 'undefined') { d.setIndex();}" size="28" style="width:140px" class="text"> </select > </body>
wrote in message news:f1c1962e-e2fd-4488-8686-e81c68931167@u6g2000prc.googlegroups.com > The problem is: > when we drag and drop the values to the empty select box. i am not > able to get the options for that select box. when i click on > viewsource, the options which i have dropped is not exist in the > select box. View Source shows the original HTML source, exactly as it was sent by the server. It simply displays the file from browser cache. View Source doesn't reflect any changes made after the page is loaded. -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
"Igor Tandetnik" wrote in message news:uLaUkiuzIHA.5108@TK2MSFTNGP05.phx.gbl... > wrote in message > news:f1c1962e-e2fd-4488-8686-e81c68931167@u6g2000prc.googlegroups.com >> The problem is: >> when we drag and drop the values to the empty select box. i am not >> able to get the options for that select box. when i click on >> viewsource, the options which i have dropped is not exist in the >> select box. > > View Source shows the original HTML source, exactly as it was sent by the > server. It simply displays the file from browser cache. View Source > doesn't reflect any changes made after the page is loaded. > -- > With best wishes, > Igor Tandetnik > If you want to see the actual DOM then there are a number of tools, IE7Pro shows a generated view-source or search for DomInspector, I think, one of the IE developer add-ons. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name