By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,364 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,364 IT Pros & Developers. It's quick & easy.

alert

P: 2
Hi,
i have a function like this:

Expand|Select|Wrap|Line Numbers
  1. function IsRowGridViewSelected(oSrc,args)
  2. {
  3.         var NomeGriglia = (oSrc.id).substring(oSrc.id.lastIndexOf("_") + 1);
  4.  
  5.         var checked = false;
  6.         var findElement = false;
  7.         for(i=0; i<document.forms[0].length && checked==false; i++) 
  8.         { 
  9.             var o = document.forms[0][i];
  10.             var idElement = o.id;
  11.  
  12.             if (idElement.match(NomeGriglia))            
  13.             {
  14.                 if (o.type == 'radio') 
  15.                 { 
  16.                     findElement =true;
  17.                     if (o.outerHTML.search('type=radio CHECKED')== -1)
  18.                         {
  19.  
  20.                         }
  21.                     else
  22.                         {
  23.                             checked=true;
  24.                             args.IsValid=true;
  25.                         }
  26.                 }
  27.                 else if (o.type == 'checkbox') 
  28.                 { 
  29.                     findElement =true;
  30.                     if (o.outerHTML.search('type=checkbox CHECKED')== -1)
  31.                         {
  32.  
  33.                         }
  34.                     else
  35.                         {
  36.                             checked=true;
  37.                             args.IsValid=true;
  38.                         }
  39.                 }                
  40.             }
  41.             if (checked == false)
  42.             {
  43.                 args.IsValid=false;
  44.             }    
  45.         }
  46.  
  47.         if (args.IsValid==false)
  48.         {
  49.             if(!findElement)
  50.             {
  51.                 alert ('Non è possibile eseguire l\'operazione poichè la Griglia risulta vuota');
  52.             }
  53.             else
  54.             {
  55.                 alert ('Selezionare un elemento della griglia');
  56.             }
  57.         }
  58.  
  59.         return args.IsValid;
  60. }
  61.  
i must write a function that control if the state of an order is "rilasciato", "schedulato", "cancellato" into a gridview and if it is
show an alert when a butto is clicked.
cn someone help?
Nov 5 '08 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
What do you mean by the state of an order? Post the corresponding HTML code (in code tags please).
Nov 5 '08 #2

P: 2
these are the columns of the grid...
state of order is "Stato"

Expand|Select|Wrap|Line Numbers
  1. <Columns>
  2.                             <ccwms:CstmBoundField DataField="Linea" HeaderText="Linea" ItemStyle-HorizontalAlign="Center" />
  3.                             <ccwms:CstmBoundField DataField="NumeroOrdine" HeaderText="Numero Ordine" ItemStyle-HorizontalAlign="Center" />
  4.                             <ccwms:CstmBoundField DataField="Prodotto" HeaderText="Prodotto" ItemStyle-HorizontalAlign="Center" />
  5.                             <ccwms:CstmTemplateField HeaderText="Descrizione">
  6.                                 <ItemTemplate>
  7.                                     <asp:label id="lblProdottoDescr" text='<%# Eval("ProdottoDescr").ToString().PadRight(20).Substring(0,20) %>' tooltip='<%# Eval("ProdottoDescr") %>' runat="server" />
  8.                                 </ItemTemplate>
  9.                             </ccwms:CstmTemplateField>    
  10.                             <ccwms:CstmBoundField DataField="Versione" Visible="false" />
  11.                             <ccwms:CstmBoundField DataField="UM" HeaderText="UM" ItemStyle-HorizontalAlign="Center" />
  12.                             <ccwms:CstmBoundField DataField="QtaProdotta" HeaderText="Qta Prodotta" ItemStyle-HorizontalAlign="Right" />
  13.                             <ccwms:CstmBoundField DataField="QtaScartata" HeaderText="Qta Scartata" ItemStyle-HorizontalAlign="Right" />
  14.                             <ccwms:CstmBoundField DataField="QtaDaProdurre" HeaderText="Qta Da Produrre" ItemStyle-HorizontalAlign="Right" />
  15.                             <ccwms:CstmTemplateField HeaderText="Data Inizio Prevista" ItemStyle-HorizontalAlign="Center">
  16.                                 <ItemTemplate>
  17.                                     <asp:label id="lblDataInizioPrevista" text='<%# Eval("DataInizioPrevista","{0:dd/MM/yyyy HH:mm}")%>' runat="server" />
  18.                                 </ItemTemplate>
  19.                             </ccwms:CstmTemplateField>                            
  20.                             <ccwms:CstmBoundField DataField="DataInizioReale" HeaderText="Data Inizio Reale" ItemStyle-HorizontalAlign="Center" />
  21.                             <ccwms:CstmBoundField DataField="Stato" HeaderText="Stato" />
  22.                             <ccwms:CstmBoundField DataField="Percorso" Visible="false" />
  23.                         </Columns>
Nov 5 '08 #3

acoder
Expert Mod 15k+
P: 16,027
Post the client-side version of your code. It's much easier to deal with when working with JavaScript and this is, after all, the JavaScript forum.

PS. please use code tags when posting code. See How to Ask a Question. Thanks!
Nov 5 '08 #4

Post your reply

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