Omar wrote:
Hi,
Could you please tell me what am I doing wrong in the next sentence?
<select name='id' onChange="window.location='dePaso.jsp?nombre=id&va lor="+this.options[this.selectedIndex].value+"'">
TIA
1- name="id" is a very bad choice of name value. And id="name" is also a
bad choice of id value. name="name" and id="id" are also bad choices.
Using the same string to identify both the name and id attributes is
also a bad coding practice.
2- In your code, it is more robust to use
window.location.href =
3- I think you are not using quotes accordingly. How about
:
onchange = "window.location.href = 'dePaso.jsp?nombre=id&valor=' +
this.options[this.selectedIndex].value;">
4- You also need to escape "&" in the href/query string to avoid
validation problems and make sure you're not referring to a named
character entity reference.
So, I would recommend:
<select onchange = "window.location.href =
'dePaso.jsp?nombre=id&valor=' +
this.options[this.selectedIndex].value;">
if id is related to the select, then you need to adjust your code
accordingly with this.id in the query string.
DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.6 :)