Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
select on search form send 'null'
21/01/2012
07:39
Avatar
efrenba
Member
Members
Forum Posts: 4
Member Since:
21/01/2012
sp_UserOfflineSmall Offline

Hi,

I've a gird with a search form enabled, one of the search conditions is a select that is filled from the server, the problem is that the first time that this select is filled and I send the query to the server, on the other side I get 'null' instead of the select's value, but, if I change to another value, and also, if I return to the first one all works fine.

what do I doing wrong?,

regards

23/01/2012
10:40
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

The simple check is - please see what is your code when you buil the select. See what data is sended from  server when the select is build

Regardas

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

24/01/2012
01:59
Avatar
efrenba
Member
Members
Forum Posts: 4
Member Since:
21/01/2012
sp_UserOfflineSmall Offline

Hi,

The PHP code is:

---

$db->exec_query("select * from gnm_unit");

$select = "<select>";
while( $row = $db->fetch_data() )
{
    $selected = ( $row["id"] == "KGS" ) ? "selected" : "";
    $select .= "<option value="". $row["id"] ."" {$selected}>". $row["name"] ."</option>";
}
$select .= "</select>";

//send response to ajax
header("Content-Type: text/html");
echo $select;

and it sends to the client:

---

<select><option value="KGS" selected>KGS</option><option value="LTS" >LTS</option><option value="UNO" >UNO</option></select>

Every is fine, well, I suppose, I have other selects declared into the Search Form except that these don't get data from server, they take them from ColModel as follow:

{name:"enabled", index:"enabled", width:100, align:"center", editable:true, search:true, formatter:"checkbox", edittype:"checkbox", stype:"select", editoptions:{value:"1:0",defaultValue:"1"}, searchoptions:{value:{0:$.security.grid.personal.disabled,1:$.security.grid.personal.enabled}, sopt:['eq']}}

//text vars

$.security.grid.personal.disabled = "Disabled";

$.security.grid.personal.enabled = "Enabled";

These last "selects" work fine, they dont send 'null' when the "select" is built.

best regards

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
59 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information