views:

882

answers:

1

Hi,

I am having some difficulties in making a form submission via a boxcomponent. I am using the boxComponent as I have customized button image, and strangely the transparency only works with boxComponent.

Basically the idea is that when I click on my boxComponent button, it will do 2 things:

  1. Submit 2 radio button values and 1 combobox value via HTTP POST to sendstock.php
  2. On successful submission, it will then proceed to the next page

Here's what I have got for the boxComponent:

var bc_button = new Ext.BoxComponent({
        autoEl: {
            tag: 'img',
            src: 'next_button.gif'
        },
        style: 'cursor: pointer;',
        listeners: {
            enable: function(c) {
                c.getEl().on('click', function() {
                myformpanel.getForm().getEl().dom.action = 'sendstock.php';
                myformpanel.getForm().getEl().dom.method = 'POST';
                myformpanel.getForm().submit({
                    success:function() {
                        window.location.replace("toNextPage.php");
                    }
                });

            });
            }

        }
});

Here is my question, the results is as per below:

comboxbox = 3, 
radiobtn1 = on
radiobtn2 = on

What I required is the value of the radiobtn1 and radiobtn2 to be submitted, should provide me with Available or NoStock, instead of on.

Also, is this the correct way to send users to the next page upon successful submission?

Thanks!

A: 

Make sure you set the inputValue config property on your radio buttons.

var rad = new Ext.form.Radio({ name: 'something', inputValue: 'purple'});

The inputValue value should then be sent on form post instead of 'on'.

neonski