View Full Version : lookforchanges in the page and warn the user .. sample code

12 Nov 2010, 8:06 PM
i tried with so many logc but i cannot acheive.. i know how to use the wndow.onebeforeunload in extjs any common function is there to check if the page have any changes..ie if user do any changes and without save if he/she leaves the page need to give the alert message, no changes leave the page without alert.. any idea... last two days i work for this scenario i cannot able to acheive........:-/if any one knows please give me the sample code.... advance thanks....

13 Nov 2010, 8:49 AM
You can use the Ext.form.BasicForm.isDirty() method of the active or currently displayed form, depending on the context, to know if the user has modified some fields in the form.

14 Nov 2010, 11:26 PM
hai scarcick thank for your reply.. but my probelm was not solved beacuse iam not using extjs form..iam using the html form ie

<form name="form1">
<input type="button" value="submit/>"

based on the above code i want to acheive it in extjs ..? is it possible.. iam new to extjs.. thanks..