Skip to content


Subversion checkout URL

You can clone with
Download ZIP


SHtml.ajaxSelect doesn't serialize ampersands (&) correctly. #1291

wants to merge 1 commit into from

2 participants


In working with a dynamic set of select boxes similar to the one at, I had difficulty if the values in the first select contained ampersands. We discussed this on the forum at

I went ahead and verified that an SHtml.ajaxText does not have this trouble.


Looks like this is a simple matter of a missing encodeURIComponent at line 933 of SHtml. I confess I am not sure how to build lift to verify this, though. I will try to get a build in tonight to check this.


Actually, I mostly take that back. Casually looking it seems that that would fix the problem. But that doesn't explain how this got introduced. Doesn't look like ajaxSelect_* ever used encodeURIComponent. So.... apologies for the noise. :)

@fmpwizard fmpwizard was assigned
@fmpwizard fmpwizard closed this in 314f84e
@fmpwizard fmpwizard deleted the diego_issue_1291 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  web/webkit/src/main/scala/net/liftweb/http/SHtml.scala
2  web/webkit/src/main/scala/net/liftweb/http/SHtml.scala
@@ -992,7 +992,7 @@ trait SHtml {
private def ajaxSelect_*(opts: Seq[SelectableOption[String]], deflt: Box[String],
jsFunc: Box[Call], func: AFuncHolder, attrs: ElemAttr*): Elem = {
- val raw = (funcName: String, value: String) => JsRaw("'" + funcName + "=' + " + value + ".options[" + value + ".selectedIndex].value")
+ val raw = (funcName: String, value: String) => JsRaw("'" + funcName + "=' + encodeURIComponent(" + value + ".options[" + value + ".selectedIndex].value)")
val key = formFuncName
val vals =
Something went wrong with that request. Please try again.