Hi,
I have created a form with 2 input fields as below
render: function() {
var header = E ('h2', { 'name': 'content' }, _('Example Form'))
var labl = E ('label' , { 'class' : 'cbi-value-title' }, _('First Option'))
var labl2 = E ('label' , { 'class' : 'cbi-value-title' }, _('Second Option'))
var input = E ('input' , { 'id' : 'cbi-first-option', 'type': 'text', 'class' : 'cbi-input-text'})
var input2 = E ('input' , { 'id' : 'cbi-second-option', 'type': 'text', 'class' : 'cbi-input-text'})
var val = E ('div', { 'class': 'cbi-value-field' } , input)
var val4 = E ('div', { 'class': 'cbi-value-field' } , input2)
var child1 = E ('div', { 'class': 'cbi-value'} , [ labl, val ])
var child2 = E ('div', { 'class': 'cbi-value'} , [ labl2, val4 ])
var form = E ('div' , {'id': 'cbi-example', 'class': 'cbi-map'},
[header, child1, child2])
return form
},
Preformatted text
As this form does not use Map or JSONMap, I am not able to understand how to send the form input values to the server side like the rpcd plugin defined as below
var callSetFormData = rpc.declare({
object: 'luci.example',
method: 'setJsonData',
params: [ 'field1', 'field2' ],
expect: { result: false }
});
Any help in this is greatly appreciated
Regards
gargsa