-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: raja_blr
Message 5 in Discussion
Here is a work around... Add this to your Code behind private void
ProdList_ItemCreated(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
TextBox t = (TextBox) e.Item.Controls[0].FindControl("qty");
Button b = (Button) e.Item.Controls[0].FindControl("btnSubmit");
b.Attributes.Add("onclick","return test('"+e.Item.ItemIndex+"');");
}
} And this javascript to you .aspx page <script>
function test(x)
{ // we are getting only the index . you can iterate through <Table>
or directlt get handle of TextBox element
var s = document.getElementById('ProdList__ctl'+x+'_qty');
// validate element as per your logic if(s.value = = "")
return false; return true;
}
</script>
HTH
-Raja
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]