Post Back
-
Hello, I have created a web user control and that contain a javascript method that check for required field. if there is a required filed not filled it return an alert. the problem is that the page post back not in the control pageload but the page that contain that control. how can i prevent from post back when a special field is required. regards.
dghdfghdfghdfghdgh
-
Hello, I have created a web user control and that contain a javascript method that check for required field. if there is a required filed not filled it return an alert. the problem is that the page post back not in the control pageload but the page that contain that control. how can i prevent from post back when a special field is required. regards.
dghdfghdfghdfghdgh
To call a javascript function prior to postback, take the button out of the form. Use the button to call javascript, and if everything is ok, use the javascript to call form.submit(). Rob http://tagyurit.com
r
-
Hello, I have created a web user control and that contain a javascript method that check for required field. if there is a required filed not filled it return an alert. the problem is that the page post back not in the control pageload but the page that contain that control. how can i prevent from post back when a special field is required. regards.
dghdfghdfghdfghdgh
use onclick = "return yourfunction()" Now from the function
return false
when you show the alert, the page will then not be posted back. :)function yourfunction()
{
if ...
{
alert('invalid');
return false;
}
return true;
}:thumbsup:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.