Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Postback on DDL with confirm 1

Status
Not open for further replies.

shiggyshag

Programmer
Dec 14, 2001
227
0
0
GB
Hi

I have a Datagrid with a dropdownlist.
When a change occurs I would like it to popup a confirm box yes/no or ok/cancel (anything like that) and if they select no it doesnt postback if they say yes then it does

Any ideas please.

Cheers
 
You can use the Attributes.Add method of the dropdownlist to add a javascript function to fire on the OnSelectedIndexChanged event


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
HI

Yes I have that it brings a confirm up but if I say ok it dosnt postback

Cheers
 
Do you have the AutoPostback property of the DDL set to True?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
You'll have to place an "if" clause in your javascript then so that if the user clicks OK the DDL will still fire the AutoPostback event that was generated e.g.


Note: my above post should have read:
add a javascript function to fire on the onchange event


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Hi

Ok I have that now working ok

Thank you

The problem this has now caused is that this is on a page withe next previous etc buttons so even if i say cancel then move to the next record it does the changes.

How can I stop this

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top