Hi thanks for the additional information. It works!
I have 4 controls that must have valid entries before the postback takes
place,
also have a popup window for each on missing.
</script>
<script language="javascript" event="onclick" for="btn_submit">
if(document.Form1.drp_dn_arriv.selectedIndex==0)
window.alert("Missing Arrival Time");
if(document.Form1.drp_dn_dtype.selectedIndex==0)
window.alert("Missing Data Type");
if(document.Form1.lstbx_dest.selectedIndex==0)
window.alert("Missing Destination");
if(document.Form1.dr_lst_event.selectedIndex==0)
window.alert("Missing Event");
if ((document.Form1.drp_dn_arriv.selectedIndex!=0) &&
(document.Form1.drp_dn_dtype.selectedIndex!=0) &&
(document.Form1.lstbx_dest.selectedIndex!=0) &&
(document.Form1.dr_lst_event.selectedIndex!=0))
{
return true;
}
else
{
return false;
}
</script>
--
Paul G
Software engineer.
"Peter Rilling" wrote:
Yes, in JavaScript.
<script language="javascript" event="onclick" for="btn_submit">
if(document.Form1.drp_dn_arriv.selectedIndex==0)
{
window.alert("Missing Arrival Time");
---> return false; <---
}
</script>
I have not done this within a handler defined in a script block, usually
just from a function or something, but this might work for you.
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com... Hi thanks for the information, just wondering is this done in Java script,
and what would it look like?
--
Paul G
Software engineer.
"Peter Rilling" wrote:
Try returning "false" from your handler when you want postback to be
canceled.
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com...
> Hi I have a page that pops up a warning box if a selection is not made, see
> below.
> <script language="javascript" event="onclick" for="btn_submit">
> if(document.Form1.drp_dn_arriv.selectedIndex==0)
> window.alert("Missing Arrival Time");
> Anyhow the btn_submit will post back to the server and reload the page. > Just wondering if anyone knows how to prevent this if the
> drp_dn_arriv.selected index = 0? This is a dropdown box and when the
index
> is 0 it means a selection has not been made. Thanks.
> --
> Paul G
> Software engineer.