Results 1 to 2 of 2

Thread: How to reset form values after cliking back button

  1. #1
    Sencha Premium Member
    Join Date
    Dec 2008
    Posts
    33

    Default How to reset form values after cliking back button

    I have a form (FormPanel) where I enter a number of values. There is a "Next" button on the form which navigates me to another page. If I click the browser's back button all entered values are lost. How to reset the enterd values? Please, help.

    I tried to declare a global variable and use myForm.getForm().getValues(); on the first page. It worked, but after the return from the second page the object is lost. The main form's properties are listed below:
    <code>
    var myForm= new Ext.FormPanel({
    frame : true,
    standardSubmit: true,
    defaults:{align:'center'},
    title : 'Reservation Form',
    bodyStyle : 'padding:5px 5px 0',
    trackResetOnLoad:true,
    labelWidth:110,width:660 ...

    </code>

  2. #2
    Sencha Premium Member
    Join Date
    Dec 2008
    Posts
    33

    Default

    Solved by myself.
    I created a HTML form and a hidden <input> control in it.
    I used
    document.frmHidden.formValues.value = Ext.encode(myFrm.getForm().getValues());

    on the return on the first page I used
    var obVal = Ext.decode(document.frmHidden.formValues.value);
    myFrm.getForm().setValues(obVal);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •