473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Validation in ajax

11
Hi,
I have ajax tab container with 6 tabs in it.
I need to validate each tab contents separately and the validtaion summary must be separate for each tab.
i cannot do that only one summary is being accesed.
i also tried with validationgroup.
Finlly i want each tab content to be validated and the content should accept the inputs.If any errors the message must display in summary separately.

Here are 2 of my tabs.Dont feel bore pls let me know the procedure.
Thanks in advance.For understanding i have send complete form.

[HTML]<cc1:TabPanel runat="server" id="tabPbill" Enabled="true" HeaderText="BillPlan">
<ContentTemplate>
<table>
<tr>
<td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;ClientName</td>
<td>&nbsp;<asp:DropDownList ID="ddbillcli" runat="server" Width="106px">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="reqddbillcli" runat="server" ErrorMessage="Select Any ClientName" ControlToValidate="ddbillcli" InitialValue="--Select--">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;ProgramName</td>
<td>&nbsp;<asp:DropDownList ID="ddbillpgm" runat="server" Width="106px">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="reqddbillpgm" runat="server" ErrorMessage="Select Any ProgramName" ControlToValidate="ddbillpgm" InitialValue="--Select--">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;BillPlan</td>
<td>&nbsp;<asp:TextBox ID="txtbillplan" runat="server" Width="100px" ValidationGroup="valgrp1"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqtxtbillplan" runat="server" ControlToValidate="txtbillplan" ErrorMessage="Enter BillPlan" InitialValue="" Display="dynamic" ValidationGroup="valgrp1">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regtxtbillplan" runat="server" ControlToValidate="txtbillplan" ErrorMessage="Enter Valid BillPlan" ValidationExpression="^[a-zA-Z]*[\s.,-]+[0-9]+$" Display="dynamic" ValidationGroup="valgrp1">*</asp:RegularExpressionValidator>
</td>
</tr>

<tr>
<td align="center" colspan="2"><asp:UpdatePanel ID="updbill" runat="Server">
<ContentTemplate>&nbsp;&nbsp;&nbsp;&nbsp;
<asp:ImageButton ID="btnbillsub" runat="server" ImageUrl="~/btnimages/submit.jpg" OnClick="btnbillsub_Click"/>
<asp:ImageButton ID="btnbillres" runat="server" ImageUrl="~/btnimages/reset.jpg" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnbillsub" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="btnbillres" EventName="Click" />
</Triggers>
</asp:UpdatePanel></td>
</tr>
<tr><td align="center" colspan="2"><asp:Label ID="lblmsg" runat="server" Font-Bold="true" ForeColor="gray" Font-Size="Small"></asp:Label></td></tr>
<tr><td align="center" colspan="2">&nbsp;</td></tr>
<tr><td align="center" colspan="2">

<asp:DataGrid ID="dgbill" runat="server" AllowPaging="True" PageSize="5" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None" OnEditCommand="dgbill_EditCommand" OnCancelCommand="dgbill_CancelCommand" OnUpdateCommand="dgbill_UpdateCommand" OnItemDataBound="dgbill_ItemDataBound" OnPageIndexChanged="dgbill_PageIndexChanged" CssClass="DataGridFixedHeader">
<FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
<SelectedItemStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<ItemStyle ForeColor="#333333" BackColor="#F7F6F3" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateColumn HeaderText="BillPlanId" Visible="False">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.iBP_ID") %>' ID="lblid"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ReadOnly="true" Text='<%# DataBinder.Eval(Container, "DataItem.iBP_ID") %>' ID="txtid"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Client">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.sCD_LegalName") %>' ID="ClientName"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList runat="server" Width="110px" DataSource='<%# client() %>' DataTextField="Client" DataValueField="iClient_ID" ID="editcli"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Program">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.sPGM_Name") %>' ID="PgmName"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList runat="server" Width="110px" DataSource='<%# pgm() %>' DataTextField="sPGM_Name" DataValueField="iPGM_ID" ID="editpgm"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="BillPlan">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.sBP_Name") %>' ID="lblbillplan"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem.sBP_Name") %>' ID="txtbillplan"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ID="reqtxtbillplan" ControlToValidate="txtbillplan" ErrorMessage="Enter BillPlan" Display="dynamic">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator runat="server" ID="regtxtbillplan" ControlToValidate="txtbillplan" ErrorMessage="Enter Valid BillPlan" Display="dynamic" ValidationExpression="[a-zA-Z]*[\s.,-]+[0-9]+">*</asp:RegularExpressionValidator>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Delete">
<ItemTemplate>
<asp:CheckBox ID="chkbox" AutoPostBack="true" runat="server" Checked='<%# chked(Convert.ToInt64(DataBinder.Eval(Container.Da taItem,"iLogicalDeletestatus"))) %>' OnCheckedChanged="chkbox_CheckedChanged" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="iLogicalDeletestatus" HeaderText="Deletestatus" ReadOnly="True"
Visible="False"></asp:BoundColumn>
<asp:EditCommandColumn CancelText="Cancel" EditText="Edit" HeaderText="Edit" UpdateText="Update">
</asp:EditCommandColumn>
<asp:BoundColumn DataField="iBP_ID" ReadOnly="True" Visible="False"></asp:BoundColumn>
<asp:BoundColumn DataField="iClient_ID" ReadOnly="True" Visible="False"></asp:BoundColumn>
<asp:BoundColumn DataField="sCD_LegalName" ReadOnly="True" Visible="False"></asp:BoundColumn>
<asp:BoundColumn DataField="iPGM_ID" ReadOnly="True" Visible="False"></asp:BoundColumn>
<asp:BoundColumn DataField="sPGM_Name" ReadOnly="True" Visible="False"></asp:BoundColumn>
</Columns>
<AlternatingItemStyle BackColor="White" ForeColor="#284775" />
</asp:DataGrid>
</td></tr>
</table>
</ContentTemplate>
</cc1:TabPanel>

<cc1:TabPanel runat="server" id="tabPphone" Enabled="true" HeaderText="PhoneType">
<ContentTemplate>
<table><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr>
<tr>
<td align="left" nowrap="nowrap">Phone Type</td>
<td><asp:TextBox ID="txtphonetype" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqtxtphonetype" runat="server" ControlToValidate="txtphonetype" ErrorMessage="Enter Phone Type" InitialValue="" Display="dynamic">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regtxtphonetype" runat="server" ControlToValidate="txtphonetype" ErrorMessage="Enter Valid Phone Type" ValidationExpression="^[a-zA-Z]*$" Display="dynamic">*</asp:RegularExpressionValidator>
</td>
<%--<tr><td colspan="2" align="left"><asp:ValidationSummary ID="valsumph" runat="server"/></td></tr>--%>
</tr>
<tr>
<td align="center" colspan="2"><asp:UpdatePanel ID="updphone" runat="Server">
<ContentTemplate>
<asp:ImageButton ID="btnphonesub" runat="server" ImageUrl="~/btnimages/submit.jpg" OnClick="btnphonesub_Click"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnphonesub" EventName="Click" />
</Triggers>
</asp:UpdatePanel></td></tr>
<tr><td align="center" colspan="2"><asp:Label ID="lblmsgph" runat="server" Font-Bold="true" ForeColor="gray" Font-Size="Small"></asp:Label></td></tr>
<tr><td align="center" colspan="2">&nbsp;</td></tr>
<tr><td align="center" colspan="2">
<asp:DataGrid ID="dgphone" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None" OnEditCommand="dgphone_EditCommand" OnCancelCommand="dgphone_CancelCommand" OnUpdateCommand="dgphone_UpdateCommand" CssClass="DataGridFixedHeader">
<FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
<SelectedItemStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<ItemStyle ForeColor="#333333" BackColor="#F7F6F3" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundColumn DataField="iPhType_ID" ReadOnly="True" Visible="False"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="PhoneTypeID" Visible="False">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.iPhType_ID") %>' ID="lblphid"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ReadOnly="true" Text='<%# DataBinder.Eval(Container, "DataItem.iPhType_ID") %>' ID="txtphid"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="PhoneType">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.sPhType_Type") %>' ID="lblphtype"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Width="100px" Text='<%# DataBinder.Eval(Container, "DataItem.sPhType_Type") %>' ID="txtphtype"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqtxtphtype" runat="server" ControlToValidate="txtphtype" Display="dynamic" ErrorMessage="Enter PhoneType" ValidationGroup="valgrp2">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regtxtphtype" runat="server" ControlToValidate="txtphtype" Display="Dynamic" ErrorMessage="Enter Valid PhoneType" ValidationExpression="[a-zA-Z]*">*</asp:RegularExpressionValidator>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:EditCommandColumn CancelText="Cancel" EditText="Edit" HeaderText="Edit" UpdateText="Update">
</asp:EditCommandColumn>
</Columns>
<AlternatingItemStyle BackColor="White" ForeColor="#284775" />
</asp:DataGrid></td></tr>
</table>
</ContentTemplate>
</cc1:TabPanel>[/HTML]
Jul 29 '08 #1
1 2046
raam
11
I got it.

add validation summaries for different tabs.
if 6 tabs 6 validations summaries.
Next add attribute "validationgroup" for required field validators and textbox,dropdown controls etc including button which fires validations.

Then each tab gets validated seperately.

Thank you.
Aug 6 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: AECL_DEV | last post by:
Hello Everyone, Ive seen alot of people saying that the best way to AJAX Validate a form is through the submit button, because validation should be synchronous. Im wondering, is there any good...
2
by: AECL_DEV | last post by:
Okay, so javascript validation is all well and good, but how would I use that to stay synchronous if I am validating against a server side database? Can I use some sort of modal...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
5
by: Advo | last post by:
Basically, im redesigning a form page on our website. Currently the user submits the form, it does a few javascript checks and either submits to the "processstuff.php" page, or gives the user a...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
1
by: John Chan | last post by:
Hi, Im doing a maintenance application in ajax and coldfusion at work on IE6 exclusively. I have a save button on each form and i have to do various validations server side and on client side...
0
by: john_c | last post by:
Sometimes I get this error in an aspx page: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/in configuration or <%@ Page...
5
by: lucyh3h | last post by:
Hi, I am trying to use XMLHttpRequest to do server side validation. I have several fields on a form and a submit button. The submit button has an event assocated with it when clicked. The...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
3
pradeepjain
by: pradeepjain | last post by:
hii guys , I wanna share a very gud ajax validation script with php... Ajax Form Validation - sForm | chains.ch weblog I am very new to ajax .So i wanna small help....i want to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.