Hello Betty,
I'm wondering whether you're wantting to perform such event/checking every
time before the user submit the form/page or do you want to do such
event/checking whenever the user has changed the selected item in
dropdownlist(html select)?
In both cases, you need to use client side script code. For the first case,
you can add a script handler for html form's onsubmit event. e.g.
<form onsubmit="xxx()">
and in that handler, you can check whether the dropdownlist(or other
element)'s value has been changed(you need to also keep the original value
for compare in the page), and then determine whether to continue the submit
or cancel it and display a alert dialog.
e.g.
=========================
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script type="text/javascript">
function form_submit()
{
if(document.getElementById("flag").value == "1")
{
return true;
}
else
{
alert("need set flag...");
return false;
}
}
function set_flag()
{
document.getElementById("flag").value = "1";
alert(document.getElementById("flag").value);
}
</script>
</head>
<body>
<form id="form1" action="" onsubmit="return form_submit();">
data: <input type="text" value="test" /><br />
<input type="button" value="set flag" onclick="set_flag();" />
<input id="flag" type="hidden" value="0" />
<input type="submit" value="submit button" />
</form>
</body>
</html>
======================================
if it is the second case, you just need to add "onchange" client-side event
for the dropdownlist and do the checking(whether the button has been
clicked) and show alert.
Does this help?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.