Javascript message before postback?

Javascript message before postback?

Post by Christopher Dedel » Sat, 15 Mar 2003 01:24:08



I have a button which resets a user's password to my site.  I would like a
message asking if the really want to reset the password to appear before the
postback (ie. Javascript's confirm method) I know this must be done client
side.  Is there any way to perform this type of client side behavior before
posting back to the server?

Thanks,

Chris Dedels

 
 
 

Javascript message before postback?

Post by Ahmet Gune » Sat, 15 Mar 2003 01:58:20


I am doing this by using client side scripting...

for example:

function submitForm()
{
    // do your checks
    if (!mycheck())
        return confirm("You really want to do this?");
    else
        return true;

Quote:}

then in html

<form runat=server name=form1 onSubmit="return submitForm()">

It works for me... Hope it works for you..

AG


Quote:> I have a button which resets a user's password to my site.  I would like a
> message asking if the really want to reset the password to appear before
the
> postback (ie. Javascript's confirm method) I know this must be done client
> side.  Is there any way to perform this type of client side behavior
before
> posting back to the server?

> Thanks,

> Chris Dedels


 
 
 

Javascript message before postback?

Post by Christopher Dedel » Sat, 15 Mar 2003 01:59:14


Got the answer.  Thanks.


Quote:> I have a button which resets a user's password to my site.  I would like a
> message asking if the really want to reset the password to appear before
the
> postback (ie. Javascript's confirm method) I know this must be done client
> side.  Is there any way to perform this type of client side behavior
before
> posting back to the server?

> Thanks,

> Chris Dedels

 
 
 

1. Postback problem when using Javascript???

Hi everybody,

I have the following drop down lists:

<td valign="middle">
     <asp:DropDownList CssClass="normal" runat="server" id="Level01DDL"
width="160" Enabled="true" onchange="CategAndManuf(this, document.all.item
('Level02DDL'), document.all.item('ManufDDL'),
document.all.item('categoriesHidden'),
document.all.item('subCategoriesHidden'), document.all.item
('subCategoriesManHidden'));"/>
</td>
<td valign="middle">
     <asp:DropDownList id="Level02DDL" CssClass="normal" width="160"
Enabled="true" AutoPostBack="true" OnSelectedIndexChanged="FetchLevel3"
runat="server"/>
</td>
<td valign="middle">
    <asp:DropDownList id="Level03DDL" CssClass="normal" width="160"
Enabled="true" AutoPostBack="true" OnSelectedIndexChanged="AdjustManufDDL"
runat="server"/>
</td>
<td valign="middle">
    <asp:DropDownList id="ManufDDL" runat="server" CssClass="normal"
width="160" Enabled="true" onchange="ManufAndCateg(this, document.all.item
('Level01DDL'),document.all.item('Level02DDL'),document.all.item('categories
Hidden'));" />
</td>

I use Javascript to filter Level02DDL and ManufDDL when Level01DDL changes
(client side)...
Javascript functions work just fine....but AutoPostBack for Level02DDL does
execute function FetchLevel3 which is implemenent in a dll (i use the
debbuger).
When i DO NOT use Javascript and every filtering in drop downs occurs with
AutoPostBacks, FetchLevel3 is executed normally....

Does client scripting is aspx files causes problems (while it shouldn't)?

Thanxs in advance
Katsikas Dimitris

2. exchange mail question

3. web client postback from javascript

4. Got a problem with \overrightarrow{} and/or \vec{}

5. Simple javascript postback fails

6. s:TurboKarte 060 u.o.PPC f.A-3000T

7. How do I trigger a button Postback from javascript.

8. WANTED: Commodore 64

9. HTML 4.01 Validation & PostBack Javascript

10. PostBack, LinkButton, delete using JavaScript

11. PostBack with client side JavaScript?

12. Cancel the postback using javascript ?

13. problem executing javascript on postback