TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
albert albert
NA
524
0
first element in comma saperated value and Jquery
May 23 2012 4:01 AM
Hi everybody,
I have a list of weeks, like this:
[code]
select
id
="
weekId
"
class
="
valid
"
onchange
="
Selectedchange();
"
name
="
weekId
"
>
<
option
value
="
{ maandag = 2-1-2012, Dindsdag = 3-1-2012 }
"
>
1
</
option
>
<
option
value
="
{ maandag = 9-1-2012, Dindsdag = 10-1-2012 }
"
>
2
</
option
>
<
option
value
="
{ maandag = 16-1-2012, Dindsdag = 17-1-2012 }
"
>
3
</
option
>
<
option
value
="
{ maandag = 23-1-2012, Dindsdag = 24-1-2012 }
"
>
4
</
option
>
<
option
value
="
{ maandag = 30-1-2012, Dindsdag = 31-1-2012 }
"
>
5
</
option
>
<
option
value
="
{ maandag = 6-2-2012, Dindsdag = 7-2-2012 }
"
>
6
</
option
>
<
option
value
="
{ maandag = 13-2-2012, Dindsdag = 14-2-2012 }
"
>
7
</
option
>
<
option
value
="
{ maandag = 20-2-2012, Dindsdag = 21-2-2012 }
"
>
8
</
option
>
<
option
value
="
{ maandag = 27-2-2012, Dindsdag = 28-2-2012 }
"
>
9
</
option
>
<
option
value
="
{ maandag = 5-3-2012, Dindsdag = 6-3-2012 }
"
>
10
</
option
>
<
option
value
="
{ maandag = 12-3-2012, Dindsdag = 13-3-2012 }
"
>
11
</
option
>
<
option
value
="
{ maandag = 19-3-2012, Dindsdag = 20-3-2012 }
"
>
12
</
option
>
<
option
value
="
{ maandag = 26-3-2012, Dindsdag = 27-3-2012 }
"
>
13
</
option
>
<
option
value
="
{ maandag = 2-4-2012, Dindsdag = 3-4-2012 }
"
>
14
</
option
>
<
option
value
="
{ maandag = 9-4-2012, Dindsdag = 10-4-2012 }
"
>
15
</
option
>
<
option
value
="
{ maandag = 16-4-2012, Dindsdag = 17-4-2012 }
"
>
16
</
option
>
<
option
value
="
{ maandag = 23-4-2012, Dindsdag = 24-4-2012 }
"
>
17
</
option
>
<
option
value
="
{ maandag = 30-4-2012, Dindsdag = 1-5-2012 }
"
>
18
</
option
>
<
option
value
="
{ maandag = 7-5-2012, Dindsdag = 8-5-2012 }
"
>
19
</
option
>
<
option
value
="
{ maandag = 14-5-2012, Dindsdag = 15-5-2012 }
"
>
20
</
option
>
<
option
value
="
{ maandag = 21-5-2012, Dindsdag = 22-5-2012 }
"
>
21
</
option
>
<
option
value
="
{ maandag = 28-5-2012, Dindsdag = 29-5-2012 }
"
>
22
</
option
>
<
option
value
="
{ maandag = 4-6-2012, Dindsdag = 5-6-2012 }
"
>
23
</
option
>
<
option
value
="
{ maandag = 11-6-2012, Dindsdag = 12-6-2012 }
"
>
24
</
option
>
<
option
value
="
{ maandag = 18-6-2012, Dindsdag = 19-6-2012 }
"
>
25
</
option
>
<
option
value
="
{ maandag = 25-6-2012, Dindsdag = 26-6-2012 }
"
>
26
</
option
>
<
option
value
="
{ maandag = 2-7-2012, Dindsdag = 3-7-2012 }
"
>
27
</
option
>
<
option
value
="
{ maandag = 9-7-2012, Dindsdag = 10-7-2012 }
"
>
28
</
option
>
<
option
value
="
{ maandag = 16-7-2012, Dindsdag = 17-7-2012 }
"
>
29
</
option
>
<
option
value
="
{ maandag = 23-7-2012, Dindsdag = 24-7-2012 }
"
>
30
</
option
>
<
option
value
="
{ maandag = 30-7-2012, Dindsdag = 31-7-2012 }
"
>
31
</
option
>
<
option
value
="
{ maandag = 6-8-2012, Dindsdag = 7-8-2012 }
"
>
32
</
option
>
<
option
value
="
{ maandag = 13-8-2012, Dindsdag = 14-8-2012 }
"
>
33
</
option
>
<
option
value
="
{ maandag = 20-8-2012, Dindsdag = 21-8-2012 }
"
>
34
</
option
>
<
option
value
="
{ maandag = 27-8-2012, Dindsdag = 28-8-2012 }
"
>
35
</
option
>
<
option
value
="
{ maandag = 3-9-2012, Dindsdag = 4-9-2012 }
"
>
36
</
option
>
<
option
value
="
{ maandag = 10-9-2012, Dindsdag = 11-9-2012 }
"
>
37
</
option
>
<
option
value
="
{ maandag = 17-9-2012, Dindsdag = 18-9-2012 }
"
>
38
</
option
>
<
option
value
="
{ maandag = 24-9-2012, Dindsdag = 25-9-2012 }
"
>
39
</
option
>
<
option
value
="
{ maandag = 1-10-2012, Dindsdag = 2-10-2012 }
"
>
40
</
option
>
<
option
value
="
{ maandag = 8-10-2012, Dindsdag = 9-10-2012 }
"
>
41
</
option
>
<
option
value
="
{ maandag = 15-10-2012, Dindsdag = 16-10-2012 }
"
>
42
</
option
>
<
option
value
="
{ maandag = 22-10-2012, Dindsdag = 23-10-2012 }
"
>
43
</
option
>
<
option
value
="
{ maandag = 29-10-2012, Dindsdag = 30-10-2012 }
"
>
44
</
option
>
<
option
value
="
{ maandag = 5-11-2012, Dindsdag = 6-11-2012 }
"
>
45
</
option
>
<
option
value
="
{ maandag = 12-11-2012, Dindsdag = 13-11-2012 }
"
>
46
</
option
>
<
option
value
="
{ maandag = 19-11-2012, Dindsdag = 20-11-2012 }
"
>
47
</
option
>
<
option
value
="
{ maandag = 26-11-2012, Dindsdag = 27-11-2012 }
"
>
48
</
option
>
<
option
value
="
{ maandag = 3-12-2012, Dindsdag = 4-12-2012 }
"
>
49
</
option
>
<
option
value
="
{ maandag = 10-12-2012, Dindsdag = 11-12-2012 }
"
>
50
</
option
>
<
option
value
="
{ maandag = 17-12-2012, Dindsdag = 18-12-2012 }
"
>
51
</
option
>
<
option
value
="
{ maandag = 24-12-2012, Dindsdag = 25-12-2012 }
"
>
52
</
option
>
</
select
>
[code]
I can get the value with JQuery like this:
[code]
function Selectedchange() {
$("#txtBox").val($("#weekId").val());
//.attr("selected",0);
}
[/code]
But I want to have the first value:
{ maandag = 2-1-2012} in a textbox.
How to do that?
THX
Reply
Answers (
3
)
Regarding image
Resolution