jeudi 8 octobre 2015

Pass '&', returned from selecetd option value, in url

<select name="n" onchange="if(this.selectedIndex != 0) window.location = this.options[this.selectedIndex].value">
  <option value="url&amp;param={param}">
     <xsl:if condition>
       <xsl:attribute name="selected">true</xsl:attribute>
     </xsl:if>
  </option>
</select>

The code above works fine, it passes selected option to url. The only problem is that when the parameter contains '&' sign in between. How do I pass parameter when it's value is something like 'A & B'? urlencode seems not helpful? Thanks for your time!




Aucun commentaire:

Enregistrer un commentaire