Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/05/2010, 19:35
Avatar de RucarMaN
RucarMaN
 
Fecha de Ingreso: julio-2003
Ubicación: Caripito Edo Monagas
Mensajes: 169
Antigüedad: 21 años, 9 meses
Puntos: 1
Busqueda Respuesta: Listas Dependientes/Encadenadas, con sus valores desde una Base de Datos (

Código HTML:
Ver original
  1. <!-- TWO STEPS TO INSTALL NO DUPLICATES:
  2.  
  3.  1.  Copy the coding into the HEAD of your HTML document
  4.  2.  Add the last code into the BODY of your HTML document  -->
  5.  
  6. <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
  7.  
  8.  
  9. <SCRIPT LANGUAGE="JavaScript">
  10. <!-- Original:  Denis Dijon ([email protected]) -->
  11. <!-- Web Site:  http://213.177.134.20 -->
  12.  
  13. <!-- This script and many more are available free online at -->
  14. <!-- The JavaScript Source!! http://javascript.internet.com -->
  15.  
  16. <!-- Begin
  17. var OptLstTxt = new Array;
  18. var OptLstVal = new Array;
  19. var OptLen = 0;
  20. function NoDupl(SelObjFrom, SelObjTo) {
  21. var OldToVal = SelObjTo.options[SelObjTo.selectedIndex].value;
  22. if (OptLen == 0) {
  23. OptLen = SelObjFrom.length;
  24. for (var i = 1; i < OptLen; i++) {
  25. OptLstTxt[i] = SelObjFrom.options[i].text;
  26. OptLstVal[i] = SelObjFrom.options[i].value;
  27.   }
  28. }
  29. var j = 1;
  30. for (var i = 1; i < OptLen; i++) {
  31. if (OptLstVal[i] != SelObjFrom.options[SelObjFrom.selectedIndex].value) {
  32. if (j == SelObjTo.length) {
  33. SelObjTo.options[j] = new Option(OptLstTxt[i]);
  34. }
  35. else {
  36. SelObjTo.options[j].text = OptLstTxt[i];
  37. }
  38. SelObjTo.options[j].value = OptLstVal[i];
  39. if (OptLstVal[i] == OldToVal) {
  40. SelObjTo.selectedIndex = j;
  41. }
  42. j++;
  43.   }
  44. }
  45. if (SelObjTo.length > j)
  46. SelObjTo.options[(SelObjTo.length - 1)] = null;
  47. }
  48. //  End -->
  49.  
  50. </HEAD>
  51.  
  52. <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
  53.  
  54.  
  55. <form method="POST" name="MForm">
  56. Try to select the same color:
  57. <br>
  58. <select name="Color_1" onChange="NoDupl(this,document.MForm.Color_2)">
  59. <option selected value=''>Select your first prefered color</option>
  60. <option value='R'>Red</option>
  61. <option value='J'>Yellow</option>
  62. <option value='G'>Green</option>
  63. <option value='B'>Blue</option>
  64. <select name="Color_2" onChange="NoDupl(this,document.MForm.Color_1)">
  65. <option selected value=''>Select Second Prefered color</option>
  66. <option value='R'>Red</option>
  67. <option value='J'>Yellow</option>
  68. <option value='G'>Green</option>
  69. <option value='B'>Blue</option>
  70. </form>
  71.  
  72. <p><center>
  73. <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
  74. by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
  75. </center><p>
  76.  
  77. <!-- Script Size:  2.34 KB -->
---------
este si te puede venir al pelo...
__________________
Con la ayuda de todos seremos mejores...

http://www.pemoweb.com