Re: use javascript without postback
- From: "web.dev" <web.dev.cs@xxxxxxxxx>
- Date: 31 Aug 2006 12:33:19 -0700
vinay wrote:
Hi All
I have a page in which i using user control .on user control i using
javascript to pop up a message .when i choose wrong date in user
control & submits the page it alerts the message of javascript but
page refrehes. I want to use javascript without page refresh or without
postback .
Is this possible to use javascript without page postback..
Thanks in advance
Vinay
Yes. It sounds like you are doing a form validation, however on
invalid entry, you are failing to stop the form submission. In that
case, you can do something like the following:
html:
<form onsubmit = "return validateForm(this)">
....your form elements...
<input type = "text" name = "userdate">
</form>
javascript:
function validateForm(myForm)
{
/*your validation routine
.
.
.
*/
if(myForm.elements["userdate"] == "some_value")
{
return true;
}
return false; //for invalid entry return false, for valid entry
return true
}
.
- References:
- use javascript without postback
- From: vinay
- use javascript without postback
- Prev by Date: Re: Animated images
- Previous by thread: Re: use javascript without postback
- Index(es):
Relevant Pages
|