Templates y Temas para ExtJS y Sencha Touch Bleext!
Bleextop! un desktop OpenSource para Ext4 y CodeIgniter http://bit.ly/pUwLJO
Como paso los valores de un Combo en un Formulario?
  • Vote Up0Vote Down peter3518peter3518 November 2011
    Posts: 45
    Hola:
    Estoy tratando de pasar los valores de un Combo desde un Formulario y no los recibo en el PHP y lamentablemente son datos muy importantes del mismo, los demás datos los recibo bien:
    Dejo código de formulario:

    [code]
    Ext.onReady(function(){
    Ext.apply(Ext.form.VTypes,{
    uppercase:function(val,field) {
    var texto = val;
    texto = Ext.util.Format.uppercase(texto);
    field.setRawValue(texto);
    return true;
    }
    });
    var simple = new Ext.form.FormPanel({
    x:200,
    renderTo:'enviar',
    standardSubmit: true,
    modal:true,
    frame:true,
    border:true,
    title: '
    Formulario de Registro :: EVENTOS
    ',
    width: 600,
    height:350,
    // defaults: {width: 240},
    defaultType: 'textfield',
    // style : {textTransform: "uppercase"},
    x:120,
    items: [{
    fieldLabel: 'Nombre',
    name: 'nombre',
    allowBlank:false,
    vtype:'uppercase',
    anchor:'90%'
    },
    {
    fieldLabel: 'Apellido',
    name: 'apellido',
    allowBlank:false,
    vtype:'uppercase',
    anchor:'90%'
    },
    {
    fieldLabel: 'Correo',
    name: 'correo',
    vtype:'email', // Validar tipo mail
    allowBlank:false,
    anchor:'90%'
    },
    {
    xtype: 'combo',
    id: 'cmbPais',
    anchor:'90%',
    fieldLabel: 'Evento',
    displayField: 'evento',
    valueField: 'id',
    triggerAction: 'all',
    mode: 'local',
    store : new Ext.data.JsonStore({
    url: 'combo3.php',
    autoLoad: true,
    root: 'datos',
    baseParams: {
    combo: 'eventos'
    },
    fields: [
    {name:'id'},
    {name:'evento'}

    ]
    }),
    listeners: {
    'select': function(c,r,i){
    st = Ext.getCmp('cmbtemas').getStore();
    st.load({
    params:{
    id_pais:r.data.id
    }
    })
    }
    }
    },
    {
    xtype: 'combo',
    id: 'cmbtemas',
    anchor:'90%',
    fieldLabel: 'Tema',
    displayField: 'tema',
    valueField: 'id',
    triggerAction: 'all',
    mode: 'local',
    store : new Ext.data.JsonStore({
    url: 'combo3.php',
    root: 'datos',
    baseParams: {
    combo: 'temas'
    },
    fields: [
    {name:'id'},
    {name:'tema'}
    ]
    }),
    listeners: {
    'select': function(c,r,i){
    st = Ext.getCmp('cmbfechas').getStore();
    st.load({
    params:{
    id_ciudad:r.data.id
    }
    })
    }
    }
    },
    {
    xtype: 'combo',
    id: 'cmbfechas',
    anchor:'90%',
    fieldLabel: 'Fecha',
    displayField: 'lugar',
    valueField: 'id',
    triggerAction: 'all',
    mode: 'local',
    store : new Ext.data.JsonStore({
    url: 'combo3.php',
    root: 'datos',
    baseParams: {
    combo: 'fechas'
    },
    fields: [
    {name:'id'},
    {name:'lugar'}
    ]
    })
    },
    {
    fieldLabel: 'Asunto',
    name: 'asunto',
    allowBlank:false,
    anchor:'90%'
    },
    {
    xtype: 'textarea',
    fieldLabel: 'Comentarios',
    name: 'comentarios',
    hideLabel: false,
    labelSeparator: '',
    height: 80,
    allowBlank:false,
    anchor: '90%'
    },
    {

    inputType: 'hidden',
    id: 'submitbutton',
    name: 'myhiddenbutton',
    value: 'hiddenvalue'
    }],
    buttons: [{
    text: 'Enviar',
    padding:'20',
    handler: function() {
    simple.getForm().getEl().dom.action = 'rcorreo.php';
    simple.getForm().getEl().dom.method = 'POST';
    simple.getForm().submit();
    }
    }]


    });
    simple.render('enviar');
    });

    Este el el PHP que debería mostrar NOMBRE, EVENTO, TEMA Y LUGAR:

    <?php<br />$nombre = $_POST['nombre'];
    $apellido = $_POST['apellido'];
    $correo = $_POST['correo'];
    $evento = $_POST['evento'];
    $tema = $_POST['tema'];
    $lugar = $_POST['lugar'];
    $asunto = $_POST['asunto'];
    $comentarios = $_POST['comentarios'];

    echo "nombre:".$_POST['nombre']; ESTA VARIABLE LA MUESTRA OK, LOS DE ABAJO PASAN VACÍOS.
    echo "eventos:".$_POST['evento'];
    echo "tema:".$_POST['tema'];
    echo "lugar:".$_POST['lugar'];

    Qué estoy haciendo mal y como lo modifico?

    Desde ya muchas gracias

    Pedro
  • 1 Answer sorted by
  • Vote Up0Vote Down peter3518peter3518 November 2011
    Posts: 45
    Solucionado!! Los nombres no correspondían...cmbtemas por un lado y temas por otro, así los otros dos del combo.

    Gracias de todos modos!
    Pedro

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Twitter

Sign In Apply for Membership

In this Discussion

Poll

No poll attached to this discussion.

Tagged