Load SQLite query results into textarea in same View - apache-flex

How can you place results from a SQLite query into a textarea?
The idea is that the user presses the 'next' button and then the textarea displays the text for the next text value in the next record. I believe that I'm passing the values correctly, but when I use trace(), the values come up as undefined.
What am I doing wrong?
protected function button6_clickHandler(event:MouseEvent):void // pushed --> button
{
var cardNumber:int = parseInt(cardNumberLabel.text);
var newcardid:int = cardNumber+1;
var sqlresult:SQLResult = stmt.getResult();
stmt.sqlConnection = conn;
conn.open(File.applicationStorageDirectory.resolvePath("FlashCards.db"));
stmt.text = "SELECT * FROM cardItems WHERE id = ?";
stmt.parameters[0] = newcardid;
stmt.execute();
trace(sqlresult.data); // value = [object Object]
stext1.text = sqlresult.data.cSide1;
trace(sqlresult.data.cSide1); // value = 'undefined'
cardNumberLabel.text = sqlresult.data.id;
trace(sqlresult.data.id); // value = 'undefined'
conn.close();
moveEffectRPart1.play();
moveEffectRPart1.addEventListener(EffectEvent.EFFECT_END, nextMoveRPart);
}
EDIT: WORKING CODE*
private function nextMoveRPart(event:EffectEvent):void
{
var cardNumber:int = parseInt(cardNumberLabel.text);
stmt.sqlConnection = conn;
conn.open(File.applicationStorageDirectory.resolvePath("FlashCards.db"));
stmt.text = "SELECT * FROM cardItems WHERE id = ?" + "AND id <= MAX(id)";
stmt.parameters[0] = cardNumber+1;
stmt.addEventListener(SQLEvent.RESULT, resultHandlerPrev);
stmt.execute();
conn.close();
moveEffectRPart2.play();
}
function resultHandlerNext(event:SQLEvent):void // result handler next
{
var result:SQLResult = stmt.getResult();
var numResults:int = result.data.length;
for(var i:int = 0; i < numResults; i++)
{
var row:Object = result.data[i];
stext1.text = row.cSide1;
stext2.text = row.cSide2;
cardNumberLabel.text = row.id;
}
}

Related

Wordpress Woocommerce - Send order data to GoogleSheets via Webhooks

So I wrote this code and it is not working as it should, it is pulling data from woocommerce Webhook with a "code.gs" code in GoogleSheets.
Problem is, if var product_name = myData.line_items[1].name; (and [2], [3] and [4].... and others) does not exist, the code does not work in GoogleSheets...
What i would like to achieve is, when i have two products in an order (myData.line_items[1].name exists, myData.line_items[2].name exists,...) that GoogleSheets would make a new line with that data for each one of the products.
function doGet(e) {
return HtmlService.createHtmlOutput("request received");
}
function doPost(e) {
var myData = JSON.parse([e.postData.contents]);
var order_number = myData.number;
var order_created = myData.date_created;
var product_name = myData.line_items[0].name;
var product_qty = myData.line_items[0].quantity;
var product_total = myData.line_items[0].total;
var produktsku = myData.line_items[0].sku;
var product_name = myData.line_items[1].name;
var product_qty = myData.line_items[1].quantity;
var product_total = myData.line_items[1].total;
var produktsku = myData.line_items[1].sku;
var product_namea = myData.line_items[2].name;
var product_qtya = myData.line_items[2].quantity;
var product_totala = myData.line_items[2].total;
var produktskua = myData.line_items[2].sku;
var product_nameb = myData.line_items[3].name;
var product_qtyb = myData.line_items[3].quantity;
var product_totalb = myData.line_items[3].total;
var produktskub = myData.line_items[3].sku;
var product_namec = myData.line_items[4].name;
var product_qtyc = myData.line_items[4].quantity;
var product_totalc = myData.line_items[4].total;
var produktskuc = myData.line_items[4].sku;
var product_named = myData.line_items[5].name;
var product_qtyd = myData.line_items[5].quantity;
var product_totald = myData.line_items[5].total;
var produktskud = myData.line_items[5].sku;
var order_total = myData.total;
var billing_email = myData.billing.email;
var billing_first_name = myData.billing.first_name;
var billing_last_name = myData.billing.last_name;
var billing_countryshort = myData.billing.country;
var payment_method = myData.payment_method_title;
var shipping_method = myData.shipping_lines[0].method_title;
var shipping_total = myData.shipping_lines[0].total;
var shipping_total = myData.shipping_lines[0].total;
var klingi = "1";
var timestamp = new Date();
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow([timestamp,order_created,order_number,product_name,produktsku,product_qty,product_total,order_total,billing_email,billing_first_name,billing_last_name,payment_method,shipping_method,shipping_total,billing_countryshort]);
if( produktskua ) {
sheet.appendRow(["Izdelek 2", "",order_number,product_namea,produktskua,product_qtya,product_totala]);
};
if( produktskub ) {
sheet.appendRow(["Izdelek 3", "",order_number,product_nameb,produktskub,product_qtyb,product_totalb]);
};
if( produktskuc ) {
sheet.appendRow(["Izdelek 4", "",order_number,product_namec,produktskuc,product_qtyc,product_totalc]);
};
}
Any ideas?
It stops working, even if I wrap it, it works only if value exists...
if( myData.line_items[1].name ) {
var product_namea = myData.line_items[1].name;
var product_qtya = myData.line_items[1].quantity;
var product_totala = myData.line_items[1].total;
var produktskua = myData.line_items[1].sku;
};
When assigning your post data to variables, you can use the ternary operator
This allows you to verify either a certain postData exists, and if not - assign an empty string to the variable in order to prevent problems with Google Sheets.
Syntax:
condition ? exprIfTrue : exprIfFalse
Sample:
var product_namea = (myData.line_items[2].name) ? myData.line_items[2].name : " ";
Also: Be careful with overwriting variable names, in your code you
have e.g. twice var product_name
Is solved like this:
function doPost(e) {
var myData = JSON.parse([e.postData.contents]);
var timestamp = new Date();
var order_created = myData.date_created;
var billing_first_name = myData.billing.first_name;
var billing_phone = myData.billing.phone;
var billing_email = myData.billing.email;
var shipping_address = myData.billing.address_1 + myData.billing.address_2;
var order_total = myData.total;
var order_number = myData.number;
var billing_last_name = myData.billing.last_name;
var billing_countryshort = myData.billing.country;
var payment_method = myData.payment_method_title;
var shipping_method = myData.shipping_lines[0].method_title;
var shipping_total = myData.shipping_lines[0].total;
var quantity_prvi = myData.line_items[0].quantity;
var linetotal_prvi = myData.line_items[0].total;
var produktsku_prvi = myData.line_items[0].sku;
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow([billing_countryshort,timestamp,order_created,"Order",order_number,billing_first_name,billing_last_name,shipping_address,billing_email,billing_phone,produktsku_prvi,quantity_prvi,linetotal_prvi,shipping_total,shipping_method,order_total,payment_method]);
var lineitems=""
for (i in myData.line_items)
if(i>0){
{
var quantity = myData.line_items[i].quantity;
var linetotal = myData.line_items[i].total;
var produktsku = myData.line_items[i].sku;
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow([billing_countryshort,timestamp,order_created,"Dodaten produkt",order_number,"","","","","",produktsku,quantity,linetotal]);
}
}
}

null104Invalid MailChimp "Invalid MailChimp API key: xxxx.."

I am trying this code for creating new campaign using MailChimp API in ASP.NET
public string CreateCampaignAndSend(string apiKey, string listID)
{
Int32 TemplateID = 100;
string campaignID = string.Empty;
MailChimpManager mc = new MailChimpManager("sampleAPIKeyXXXXXXXXXXXXXX-us12");
// compaign Create Options
campaignCreateOptions campaignCreateOpt = new campaignCreateOptions();
campaignCreateOpt.list_id = listID;
campaignCreateOpt.subject = "subject";
campaignCreateOpt.from_email = "wisdomthnkrs#gmail.com";
campaignCreateOpt.from_name = "abc";
campaignCreateOpt.template_id = TemplateID;
campaignCreateOpt.authenticate = true;
campaignCreateOpt.auto_footer = false;
campaignCreateOpt.tracking.opens = true;
campaignCreateOpt.tracking.html_clicks = true;
campaignCreateOpt.tracking.text_clicks = true;
// Content
Dictionary<string, string> content = new Dictionary<string, string>();
content.Add("html_ArticleTitle1", "ArticleTitle1");
content.Add("html_ArticleTitle2", "ArticleTitle2");
content.Add("html_ArticleTitle3", "ArticleTitle3");
content.Add("html_Article1", "Article1");
content.Add("html_Article2", "Article2");
//Conditions
List<campaignSegmentCondition> csCondition = new List<campaignSegmentCondition>();
campaignSegmentCondition csC = new campaignSegmentCondition();
csC.field = "interests-" + 123; // where 123 is the Grouping Id from listInterestGroupings()
csC.op = "all";
csC.value = "";
csCondition.Add(csC);
// Options
campaignSegmentOptions csOptions = new campaignSegmentOptions();
csOptions.match = "all";
// Type Options
Dictionary<string, string> typeOptions = new Dictionary<string, string>();
typeOptions.Add("offset-units", "days");
typeOptions.Add("offset-time", "0");
typeOptions.Add("offset-dir", "after");
// Create Campaigns
campaignCreateParms campaignCreateParms = new campaignCreateParms(mc.APIKey, EnumValues.campaign_type.regular, campaignCreateOpt, content, csOptions, typeOptions);
campaignCreateInput campCreateInput = new campaignCreateInput(campaignCreateParms);
campaignCreate campaignCreate = new campaignCreate(campCreateInput);
//xyz();
//string abc = xxxxxxxxxxxxxxxxx;
campaignCreateOutput ccOutput = campaignCreate.Execute(campCreateInput);
List<Api_Error> error = ccOutput.api_ErrorMessages; // Catching API Errors
string s = "null";
if (error.Count <= 0)
{
campaignID = ccOutput.result;
}
else
{
foreach (Api_Error ae in error)
{
Console.WriteLine("\n ERROR Creating Campaign : ERRORCODE\t:" + ae.code + "\t ERROR\t:" + ae.error);
s = s + ae.code;
s = s + ae.error;
}
}
return s;
}
but it shows an error while I am giving the right key.
here is the error,
null104Invalid MailChimp "Invalid MailChimp API key:
6ea29f158xxxxxxxxxxxx"

OracleDependency OnChange event fires repetedly

On page load i called OracleDependency object. Its working perfect when first time page loads.
means if changes occur in the tables associated with the query(some joins tables are there), than OracleDependency OnChange event fires once. which is perfect.
But when i refresh the page again and some changes done in same tables than the OracleDependency OnChange event fires two time. if refresh 3 time than onchange fires three time like that. By which i am facing some problem when it fires more than one.
I gone through the solutions of issues like that but no luck.
Code: To call On change:
private DataTable CaseListNotification(Int64 appId, Int64 personId, string value, ref int refOpenCases, ref int refMyCases, ref int refPriorityCases, ref int refEta, string isClosedShow, string isOnholdShow)
{
OracleDependency oracleDependency = null;
//oracleConnection.Open();
OracleCommand oracleCommand = null;
OracleConnection oracleConnection = null;
OracleParameter appIdParamIn = null;
OracleParameter personIdParamIn = null;
OracleParameter casesCursorParamOut = null;
OracleParameter openCasesParam = null;
OracleParameter myCasesParam = null;
OracleParameter highPriorityCasesParam = null;
OracleParameter etaCasesParam = null;
OracleParameter isShowClosedParam = null;
OracleParameter isShowOnHoldParam = null;
DataTable dataTable = new DataTable();
try
{
oracleConnection = Connection.GetGeneralConnection();
oracleCommand = new OracleCommand("Data.get_data_list", oracleConnection);
oracleCommand.CommandType = CommandType.StoredProcedure;
appIdParamIn = new OracleParameter("p_app_id", OracleDbType.Int32, ParameterDirection.Input);
oracleCommand.Parameters.Add(appIdParamIn).Value = appId;
personIdParamIn = new OracleParameter("p_pe_id", OracleDbType.Int32, ParameterDirection.Input);
oracleCommand.Parameters.Add(personIdParamIn).Value = personId;
isShowClosedParam = new OracleParameter("p_isShow_Closed", OracleDbType.Varchar2, 1, null, ParameterDirection.Input);
oracleCommand.Parameters.Add(isShowClosedParam).Value = isClosedShow;
isShowOnHoldParam = new OracleParameter("p_isShow_OnHold", OracleDbType.Varchar2, 1, null, ParameterDirection.Input);
oracleCommand.Parameters.Add(isShowOnHoldParam).Value = isOnholdShow;
openCasesParam = CommonFunction.CreateInt32OracleParam("o_open_cases", oracleCommand, null, ParameterDirection.Output);
myCasesParam = CommonFunction.CreateInt32OracleParam("o_my_cases", oracleCommand, null, ParameterDirection.Output);
highPriorityCasesParam = CommonFunction.CreateInt32OracleParam("o_high_priority", oracleCommand, null, ParameterDirection.Output);
etaCasesParam = CommonFunction.CreateInt32OracleParam("o_eta", oracleCommand, null, ParameterDirection.Output);
casesCursorParamOut = new OracleParameter("o_case_list", OracleDbType.RefCursor);
casesCursorParamOut.Direction = ParameterDirection.Output;
oracleCommand.Parameters.Add(casesCursorParamOut);
if (value == "notification")
{
oracleCommand.Notification = null;
oracleDependency = new OracleDependency(oracleCommand);
oracleDependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
oracleCommand.Notification.IsNotifiedOnce = false;
oracleCommand.AddRowid = true;
}
OracleDataAdapter oracleDataAdapter = new OracleDataAdapter(oracleCommand);
oracleDataAdapter.Fill(dataTable);
if (openCasesParam.Value != null)
refOpenCases = Convert.ToInt32(((Oracle.DataAccess.Types.OracleDecimal)(openCasesParam.Value)).Value);
if (myCasesParam.Value != null)
refMyCases = Convert.ToInt32(((Oracle.DataAccess.Types.OracleDecimal)(myCasesParam.Value)).Value);
if (highPriorityCasesParam.Value != null)
refPriorityCases = Convert.ToInt32(((Oracle.DataAccess.Types.OracleDecimal)(highPriorityCasesParam.Value)).Value);
if (etaCasesParam.Value != null)
refEta = Convert.ToInt32(((Oracle.DataAccess.Types.OracleDecimal)(etaCasesParam.Value)).Value);
Connection.ReleseGeneralConnection(oracleConnection);
return dataTable;
}
catch (Exception ex)
{
throw ex;
}
}
OnChange Method :
private void dependency_OnChange(object sender, OracleNotificationEventArgs e)
{
OracleDependency dependency = sender as OracleDependency;
// NOTE: the following code uses the normal .Net capitalization methods, though
// the forum software seems to change it to lowercase letters
dependency.OnChange -= new OnChangeEventHandler(dependency_OnChange);
new GetRecordsHub().ShowRecords();
}
Procedures:
PROCEDURE get_data_list(p_app_id in t_id,
p_pe_id in t_id,
p_isShow_Closed in t_name,
p_isShow_OnHold in t_name,
o_open_cases out t_id,
o_my_cases out t_id,
o_high_priority out t_id,
o_eta out t_id,
o_case_list out sys_refcursor) IS C_FUN CONSTANT t_name :='get_data_list';
BEGIN
OPEN o_case_list for
SELECT distinct ca.ca_id, ca.ca_number as CaseNumber,
cud.cud_name AS Customer, lod.lde_name AS Location,
ca.ca_summary AS Subject, pe.pe_first_name ||' ' || pe.pe_last_name AS Owner,
te.txt_display_text AS Type, ca.ca_created_date AS CreatedDate,
ca.ca_created_date AS CreatedDateForNotification,
ca.ca_updated_date AS UpdatedDate, ca.ca_updated_date AS
UpdatedDateForNotification, dr.pe_first_name ||' ' || dr.pe_last_name AS
Driver, ops.pe_first_name ||' ' || ops.pe_last_name AS OpsManager,
tepr.txt_display_text AS Priority, tere.txt_display_text AS CaseReason,
(select count(caco_id) from wb_case_comments where CACO_CA_ID = ca.ca_id)
as CmmentCounts,
(SELECT caco_comments FROM wb_case_comments
WHERE caco_id=(select max(caco_id)
from wb_case_comments
where CACO_CA_ID = ca.ca_id and
caco_app_id = p_app_id)
) as LatestComments
FROM wb_cases ca, cu_customers cud,cu_locations lo,
cu_location_dsls lod,cu_persons pe,cu_persons dr,cu_persons ops,
di_texts te,di_texts tepr,di_texts tere
where ca.ca_app_id = cud.cud_app_id AND
ca.ca_cu_id = cud.cud_cu_id and
cud.cud_is_active = 1 AND ca.ca_lo_id = lo.lo_id(+)
AND lo.lo_id = lod.lde_lo_id(+) AND
ca.ca_pe_id_owner = pe.pe_id(+) AND
ca.ca_pe_id_driver = dr.pe_id(+) AND
ca.ca_pe_id_opsmanager = ops.pe_id(+) AND
ca.ca_iv_code_status = te.txt_code(+) AND
ca.ca_iv_code_severity = tepr.txt_code(+) AND
ca.ca_iv_code_reason = tere.txt_code(+) and
ca.ca_app_id = p_app_id and lo.lo_app_id = p_app_id
and lod.lde_app_id = p_app_id and pe.pe_app_id = p_app_id
and dr.pe_app_id = p_app_id and te.txt_app_id = p_app_id
and tepr.txt_app_id = p_app_id and tere.txt_app_id = p_app_id
order by ca.ca_id desc;
Please help.

Exit ListView Update Mode after clicking button

I currently am using a listview to edit and update data. When I click edit it goes into the edit format that I want it to. I want to be able to exit the entire edit mode after the update button is clicked. Is this possible?
When I use ListView1.EditIndex = -1 it doesn't go back to the regular view.
protected void ListView1_ItemUpdating(object sender, ListViewUpdateEventArgs e)
{
updateButton = true;
ListViewItem lvl = ListView1.Items[e.ItemIndex];
var formTitleListBox = (ListBox)lvl.FindControl("ListBox1");
var controlTypeListBox = (ListBox)lvl.FindControl("ControlType");
var formSectionListBox = (ListBox)lvl.FindControl("formsection");
var sortOrderTextBox = (TextBox)lvl.FindControl("SortOrderTextBox");
var subsectionListBox = (ListBox)lvl.FindControl("subsection");
var subSectionTextBox = (TextBox)lvl.FindControl("SubSectionOrderTextBox");
var sectionItemListBox = (ListBox)lvl.FindControl("sectionitem");
var sectionSortOrderTextBox = (TextBox)lvl.FindControl("SectionSortOrderTextBox");
var validationRuleListBox = (ListBox)lvl.FindControl("RuleDesc");
var crossItemListBox = (ListBox)lvl.FindControl("CrossItem");
var hiddenID = (HiddenField)lvl.FindControl("HiddenPrimaryID");
using (SqlConnection connection = new SqlConnection("Data Source=RCK-HRSA-DB01;Initial Catalog=ORHP_Dev03182014;User ID=ohitrural;Password=0h!trural"))
{
try
{
SqlCommand cmd1 = new SqlCommand("UPDATE ORHP_Dev03182014.Core.Form_Section_SubSection_Item_Rel SET FormID = #FormTitle, FormSectionID = #FormSection, SubSectionID = #SubSection, SectionItemID = #SectionItem, SortOrder = #SortOrder, SectionSortOrder = #SectionSortOrder, SubSectionSortOrder = #SubSectionSortOrder, ValidationRulesetId = #RuleDesc, ControlTypeID = #ControlType, CrossItemID = #CrossItem WHERE DataCollectionPeriodID = " + DropDownList2.SelectedValue + " AND FormSectionSubSectionItemRelID = #FormSectionSubSectionID");
connection.Open();
cmd1.Connection = connection;
cmd1.CommandType = CommandType.Text;
cmd1.Parameters.AddWithValue("#FormTitle", formTitleListBox.SelectedValue);
cmd1.Parameters.AddWithValue("#ControlType", DbNullIfNull(controlTypeListBox.SelectedValue));
cmd1.Parameters.AddWithValue("#FormSection", formSectionListBox.SelectedValue);
cmd1.Parameters.AddWithValue("#SortOrder", DbNullIfNull(sortOrderTextBox.Text));
cmd1.Parameters.AddWithValue("#SubSection", subsectionListBox.SelectedValue);
cmd1.Parameters.AddWithValue("#SubSectionSortOrder", DbNullIfNull(subSectionTextBox.Text));
cmd1.Parameters.AddWithValue("#SectionItem", sectionItemListBox.SelectedValue);
cmd1.Parameters.AddWithValue("#SectionSortOrder", DbNullIfNull(sectionSortOrderTextBox.Text));
cmd1.Parameters.AddWithValue("#RuleDesc", DbNullIfNull(validationRuleListBox.SelectedValue));
cmd1.Parameters.AddWithValue("#CrossItem", DbNullIfNull(crossItemListBox.SelectedValue));
cmd1.Parameters.AddWithValue("#FormSectionSubSectionID", hiddenID.Value);
cmd1.ExecuteNonQuery();
SqlDataAdapter dt = new SqlDataAdapter(cmd1);
DataSet ds = new DataSet();
searchDS = new DataSet();
dt.Fill(ds);
searchDS = ds;
UpdatePanel1.Update();
ListView1.DataSource = searchDS;
ListView1.EditIndex = -1;
ListView1.DataBind();
e.Cancel = true;
}
catch (Exception ex)
{
}
}
}
Add ListView1.DataBind(); and also e.Cancel = true;.
// ...
cmd1.ExecuteNonQuery();
ListView1.EditIndex = -1;
ListView1.DataBind()
e.Cancel = true;
// ...
Side-note: remove the empty catch if you want to notice if something goes wrong.

Need to Retrieve data from dynamically added text boxes

I added text boxes dynamically in ASP.Net from server side. By using one example which is shown in followed link
http://www.dotnettips4u.com/2013/03/dynamically-creating-text-boxes-using-c.html.
But I couldn't find out how to retrieve values from those text boxes..
Please help me to come out from this..
Here I am posting my code also..
Client Side Code:
<asp:TextBox ID="NoOfPsngr" runat="server" />
<asp:Button ID="AddP" runat="server" Text="Add Passengers" OnClick="AddP_Click" />
<asp:Panel runat="server" ID="passengerdet">
</asp:Panel>
Server Side Code:
protected void AddP_Click(object sender, EventArgs e)
{
int rowCount = Convert.ToInt32(NoOfPsngr.Text);
Table table = new Table();
table.ID = "PsngrTbl";
//Create the textboxes and labels each time the button is clicked.
for (int i = 0; i < rowCount; i++)
{
TableRow row = new TableRow();
TableCell namelblCell = new TableCell();
Label namelbl = new Label();
namelbl.Text = "Name";
TableCell nameTxtCell = new TableCell();
TextBox nameTxt = new TextBox();
TableCell typelblCell = new TableCell();
Label typelbl = new Label();
typelbl.Text = "Type";
TableCell typeSelectCell = new TableCell();
DropDownList typeSelect = new DropDownList();
ListItem adultItem = new ListItem();
adultItem.Text = "Adult";
adultItem.Value = "Adult";
typeSelect.Items.Add(adultItem);
ListItem childItem = new ListItem();
childItem.Text = "Child";
childItem.Value = "Child";
typeSelect.Items.Add(childItem);
ListItem infantItem = new ListItem();
infantItem.Text = "Infant";
infantItem.Value = "Infant";
typeSelect.Items.Add(infantItem);
TableCell etktlblCell = new TableCell();
Label etktlbl = new Label();
etktlbl.Text = "Eticket No";
TableCell etktTxtCell = new TableCell();
TextBox etktTxt = new TextBox();
//Adding.....
namelblCell.Controls.Add(namelbl);
typelblCell.Controls.Add(typelbl);
etktlblCell.Controls.Add(etktlbl);
nameTxtCell.Controls.Add(nameTxt);
typeSelectCell.Controls.Add(typeSelect);
etktTxtCell.Controls.Add(etktTxt);
nameTxt.ID = "PName" + i;
typeSelect.ID = "PType" + i;
etktTxt.ID = "ETkt" + i;
row.Controls.Add(namelblCell);
row.Controls.Add(nameTxtCell);
row.Controls.Add(typelblCell);
row.Controls.Add(typeSelectCell);
row.Controls.Add(etktlblCell);
row.Controls.Add(etktTxtCell);
table.Rows.Add(row);
}
passengerdet.Controls.Add(table);
}
use javascript like
$('#PsngrTbl').find('input[type=radio]').each(function (index, element) {
var o = $(this);
var oID = o.attr("id");
var oValue;
var controlName = $(this).attr('name');
if ($('[name=' + controlName + ']:checked').val() == undefined) {
oValue = "";
}
else {
oValue = $('[name=' + controlName + ']:checked').val();
}
});
$('#PsngrTbl').find('input[type=checkbox]').each(function (index, element) {
var o = $(this);
var value;
if (o.on == true) {
value = 1;
}
else {
value = 0;
}
var oID = o.attr("id");
var oValue = value;
});
$('#PsngrTbl').find('textarea').each(function (index, element) {
var o = $(this);
var oID = o.attr("id");
var oValue = o.val();
});
$('#PsngrTbl').find('select').each(function (index, element) {
var o = $(this);
var oID = o.attr("id");
var oValue = o.val();
});
It will return all values of controlls of that table

Categories

Resources