This is a migrated thread and some comments may be shown as answers.

Accessing value of dropdownlist to send to mysql via php

2 Answers 134 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Jan Ubbo
Top achievements
Rank 1
Jan Ubbo asked on 16 Mar 2012, 06:20 PM
Hello fellow Kendo's,

sorry to be n00by, probably it's very simple...
I am trying to read out a value of a dropdown-list to pass to a php file for mysql query...

Attached is the file, you can also see it live here:
http://www.trinamic.com/psearch/

Upon selecting a motor type, i can already coax out an alert, but how do i get the value in there?

I've tried a variety of stuff:
(motor.text());

and

var mdropdownlist = $("#motor").data("kendoDropDownList");
var text = mdropdownlist.text(); 

but to no avail...

Can anyone help? It would be much appreciated ; )


Kind regards from Germany, Ubbo

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 19 Mar 2012, 08:38 AM
Hi,

 You need to use the value method of the dropdown list to get its value. You can also check the client side API demo.

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jan Ubbo
Top achievements
Rank 1
answered on 20 Mar 2012, 12:21 AM
Hi Atanas Korchev,

sweet! That worked out...
Thanks for the quick help ; )
Unfortunatly I already bumped into the next snag, but it concerns the grid widget, so I'll post it there (one i got that I should be good to go).

Kind regards, Ubbo
Tags
DropDownList
Asked by
Jan Ubbo
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jan Ubbo
Top achievements
Rank 1
Share this question
or