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:
Component: manipulation Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Appending new option using below code

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

generates wrong HTML

<option value="United" kingdom="">United Kingdom</option>
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

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