Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/03/2014, 22:38
fabianfmedina
 
Fecha de Ingreso: marzo-2014
Ubicación: Colombia
Mensajes: 9
Antigüedad: 10 años, 1 mes
Puntos: 0
Respuesta: Saber que select escogio el usuario.

RESUELTO, buscando y buscando encontré la solución. El código fue:
Código Javascript:
Ver original
  1. var activeElement;
  2. function blurFunc() {
  3. activeElement = null; /* Cuando el elemento deja de estar activo el elemento activo pasa a ser nulo (null) */
  4. }
  5. function focusFunc(evento) {
  6.  if(!evento) { // Para IE
  7. evento = window.event;
  8. activeElement = evento.srcElement; /* Cuando un elemento se activa (focus) lo indicamos */
  9. } else { // Para otros navegadores
  10. activeElement = evento.target;
  11. }
  12.  
  13. // Lo utilizaremos para hacer la prueba
  14. document.getElementById('nombreelemento').value = activeElement.id;
  15. }
  16. function init() {
  17. for (var i = 0; i < document.forms.length; i++) {
  18. for(var j = 0; j < document.forms[i].elements.length; j++) {
  19. document.forms[i].elements[j].onfocus = focusFunc;
  20. document.forms[i].elements[j].onblur = blurFunc;
  21. }
  22. }
  23. }

Dicho código me da el ID del elemento activo del formulario cuando hago click sobre el. Muchas Gracias.