Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / August 2006



Tip: Looking for answers? Try searching our database.

use javascript without postback

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vinay - 31 Aug 2006 18:47 GMT
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
Sym - 31 Aug 2006 19:46 GMT
> Hi All
> I have a page in which i using user control .on user control i using
[quoted text clipped - 5 lines]
> 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.
Sym - 31 Aug 2006 19:46 GMT
> Hi All
> I have a page in which i using user control .on user control i using
[quoted text clipped - 5 lines]
> 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.
web.dev - 31 Aug 2006 20:33 GMT
> Hi All
> I have a page in which i using user control .on user control i using
[quoted text clipped - 5 lines]
> 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
}
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.