javascript - Value not coming into the textbox -


i have webservice code been called on pagemethod javascript fill textbox value, not getting filled.

here webservice code:

[webmethod] public static list<string> getstatus(string statuschk) {     list<string> status = new list<string>();      if (!string.isnullorempty(statuschk))     {         datatable dtgridstatus = new datatable();         oracleconnection con = new oracleconnection(system.configuration.configurationmanager.connectionstrings["oracleconn"].tostring());          con.open();         string strsql = "select flat_no ||'~'|| flat_status status xxacl_pn_flat_det_v flat_id = '" + statuschk + "'";         oracledataadapter odaptunit = new oracledataadapter(strsql, con);          odaptunit.fill(dtgridstatus);         (int = 0; < dtgridstatus.rows.count; i++)         {             status.add(dtgridstatus.rows[i][0].tostring());         }         con.close();     }      return status; } 

it returns me flat_id , use webservice in javascript fill textbox below:

 function funchangestatus() {         pagemethods.getstatus(document.getelementbyid('ddlunit').value, onstatuschange);     }     function onstatuschange(status) {         strstatus = status.split('~');         document.getelementbyid("txtstatus").value = strstatus[0];     } 

but not getting filled.

try this:

function onstatuschange(status) {         strstatus = status[0].split('~');         document.getelementbyid("txtstatus").value = strstatus[0];     } 

Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -