| | |
Textbox text changed and js confirmbox
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2009
Posts: 1
Reputation:
Solved Threads: 0
I have multiple textboxs which are created dynamically in page_load.
TextBox tb = new TextBox();
tb.id = "ID1";
tb.text = GetfromDB();
tb.TextChanged +=new EventHandler(tb_TextChanged);
Now i want to add a javascript confirmbox as
tb.Attributes.Add("onchange","javascript:return confirm('Data has Changed. Click OK To Continue');");
If the user clicks ok then continue to tb_TextChanged function and if user clicks cancel i want to restore the previous value of textbox.
How can i write the javascript function?
Thanks
TextBox tb = new TextBox();
tb.id = "ID1";
tb.text = GetfromDB();
tb.TextChanged +=new EventHandler(tb_TextChanged);
Now i want to add a javascript confirmbox as
tb.Attributes.Add("onchange","javascript:return confirm('Data has Changed. Click OK To Continue');");
If the user clicks ok then continue to tb_TextChanged function and if user clicks cancel i want to restore the previous value of textbox.
How can i write the javascript function?
Thanks
![]() |
Similar Threads
- TextBox.Text changed with js don't keep value on postback (ASP.NET)
- c# Changing Textbox.Text from different class (C#)
- textbox text validation (C#)
- text box input (C#)
- Replicating Screen textbox.text to defined printed area (VB.NET)
- textbox.text not showing up (VB.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Crystal Report Best Practice Question
- Next Thread: Getting ComboBox Value
Views: 288 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# cac chat checkbox child class compatible complex content contenttype control countryselector courier database datagrid datagridview datalist deployment development dgv dialog dropdown dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv folder form gridview gudi identity iis image javascript languages list maps menu mobile mssql nameisnotdeclared novell opera order problem profile ratings redirect refer registration relationaldatabases response.redirect rows search security select serializesmo.table sessionvariables silverlight smoobjects software sql ssl tracking treeview typeof validatedate validation vb vb.net vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment wizard xsl





