By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,384 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,384 IT Pros & Developers. It's quick & easy.

use javascript without postback

P: n/a
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

Aug 31 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Sym
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
You mention control and postbacks, are you producing the page via asp ?

Javascript can validate data on the page, but if anything is to be done
on the server you have to resubmit/postback or use say ajax. Also if
the control is server side and you have a change etc event associated
with it, it will do a postback.

I am not sure i can help more without some html/javascript examples of
your problem tho.
rgds
Symeon.

Aug 31 '06 #2

P: n/a
Sym
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
You mention control and postbacks, are you producing the page via
asp.net ?

Javascript can validate data on the page, but if anything is to be done
on the server you have to resubmit/postback or use say ajax. Also if
the control is server side and you have a change etc event associated
with it, it will do a postback.

I am not sure i can help more without some html/javascript examples of
your problem tho.
rgds
Symeon.

Aug 31 '06 #3

P: n/a

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
Aug 31 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.