1. #1
    Ext User
    Join Date
    Jul 2008
    Posts
    7
    Vote Rating
    0
    lyo is on a distinguished road

      0  

    Default If I set DateField disabled ,I can't get value

    If I set DateField disabled ,I can't get value


    Hi friends:

    I want to set the DateField to "disable:true"(Because I don't want the user select Datepicker,readOnly can't help). But I find that If I set the DateField to disabled,I can't get the DateField's value in the server side. I means that:

    My js code:
    Code:
     new Ext.form.DateField({
                    fieldLabel: 'datetimetoday',
                    name: 'outtime',
        disabled:true,
        altFormats: 'Y-m-d H:i:s',
        value:(new Date()),
                }),
    In the server side (Java),I can't get the value "outtime"
    Code:
    String outtime =request.getParameter("outtime");
    System.out.println("get outtime data:"+outtime);
    //print: null
    In the server side,it print "null".
    If I set the disabled to true,I can get the "outtime" value. Why ? How to get the disabled DateField's value? Thks!

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,505
    Vote Rating
    52
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Disabled fields are not submitted, that is standard HTML form behaviour.

    Do you really want a readOnly field?

  3. #3
    Ext User
    Join Date
    Jul 2008
    Posts
    7
    Vote Rating
    0
    lyo is on a distinguished road

      0  

    Default


    Yes,I don't want to user select a datepicker. I find that user remain could change the field's value although I set it to readOnly. Common textfield is hard to set a date format text into it. How to use a readonly datefield?

Thread Participants: 1