Skip to main content

Bug Tracker

Side navigation

#9753 closed bug (invalid)

Opened July 06, 2011 05:33AM UTC

Closed July 06, 2011 12:42PM UTC

Last modified March 14, 2012 04:34AM UTC

Setting option value (containing space) using append

Reported by: madhurs99 Owned by:
Priority: low Milestone: 1.next
Component: manipulation Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

Appending new option using below code

var OptionDesc = "United Kingdom";
var OptionValue = "United Kingdom"
$('select').append("<Option value="+OptionValue+" >"+OptionDesc+"</Option>");

generates wrong HTML

<select>
<option value="United" kingdom="">United Kingdom</option>
</select>
Attachments (0)
Change History (3)

Changed July 06, 2011 05:56AM UTC by madhurs99 comment:1

Please find below the test case for the same

http://jsfiddle.net/madhurs99/y8Mbw/

Changed July 06, 2011 12:42PM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

The value attribute needs to be quoted if it contains spaces.

Changed July 06, 2011 01:13PM UTC by timmywil comment:3

component: unfiledmanipulation
priority: undecidedlow