[Javascript] script request PassSelectOneText(form)

Chris Tammes chris_tammes at hotmail.com
Tue Feb 4 10:41:23 CST 2003


Hi there,

At this link: https://lists.latech.edu/pipermail/javascript/2002-August/003965.html

I found a script of yours and it really helped me out. You said you could mail such for select-multiple. I would ask you to mail me the script because It would would be of great help.

If the links doesn't work, this is the script I talk about:

<script LANGUAGE="JavaScript">
<!--
function PassSelectOneText(form) {
  for (var i = 0; i < form.elements.length; i++)  {
		if (form.elements[i].type == 'select-one')  {
			GetSelectOneText(form,form.elements[i]);
		}
	}
  function GetSelectOneText(form,selectOne) {
    var text = selectOne.options[selectOne.selectedIndex].text;  
    var exists = false;
    var name = selectOne.name+'Text'
    for (var i = 0; i < form.elements.length; i++)  {
		  if (form.elements[i].name == name)  {
			  exists = true
		  }
	  }
	  if (!exists) {
		  form.innerHTML += '<input type="hidden" name="' + name + '">'
    }
    form.elements[name].value = text;
  }
}

// -->
</script>

Thanks,

Chris Tammes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20030204/e9063654/attachment.htm>


More information about the Javascript mailing list