473,386 Members | 1,763 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,386 software developers and data experts.

alert

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
3 1428
acoder
16,027 Expert Mod 8TB
What do you mean by the state of an order? Post the corresponding HTML code (in code tags please).
Nov 5 '08 #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
16,027 Expert Mod 8TB
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

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

Similar topics

15
by: optimistx | last post by:
How to write a function f(x) or f('x') so that it produces the same output as a call to alert-function: var x='abc'; alert('x='+x); In testing one needs to write similar alert() calls...
2
by: schieco | last post by:
The following code always prints the debug lines inside the conditional if statement before and after the alert statement when the session has timed out, but the alert and redirect only appear/work...
4
by: hugo2 | last post by:
Most of these characters are not on the standard keyboard. Here's a successful contrivance, with comments & cautions, a little page that works in IE6. <HTML><HEAD><SCRIPT TYPE="text/javascript">...
11
by: Alistair Saldanha | last post by:
I'm looking for the event that is fired by Internet Explorer to an "alert": <SCRIPT> Alert("You already have a session open") </SCRIPT> The event would be webBrowser.Document.???? Much...
0
by: Stephanie | last post by:
I have a problem with an Alert that is supposed to invoke a Job. Here are some details: Windows Server 2000 SQL Server Standard Ed. ver. 8.00.818 (Sp3) Alert: SQL Server performance condition...
3
by: umdsasha | last post by:
So, basically, I need to detect whether an alert window was thrown. I can't find where it's thrown from but I need to disable a button only if there were no alert windows thrown. Any ideas? ...
4
by: joe | last post by:
Hi, I defined: <div id="abc"> </div> in my .html file, after an Ajax query my weberserver sends: <script language="JavaScript"> alert('Hello World!"); </script>
5
by: vjsv2007 | last post by:
Can you help to make one alert with all details? <script type="text/javascript"> <!-- function validate_form ( ) { valid = true;
24
by: Jeremy J Starcher | last post by:
While reading c.l.j, I've noticed that some people prefer and indeed even recommend the use of "window.alert()" over "alert()". I can't find any technical reason to make this distinction, and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.