#102707
Giovanni Zomer
Participant

Hi, Peter,
I don’t have problems getting the values of the elements in the form; my problem is the “submit”-event; if I look which data are arriving from the submitting form, I find all textboxes and checkboxes (for these ones: only if the are selected), but I don’t get any information about dropdown-select values;
I put here a form-example, changed to submit via GET (instead of normal POST) just to look at the values sent the easier way; as you can see, no one of the  selected dropdownlistvalues are submitted;
I’m now working with a workaround without directly submitting the form:
– button calls a js-function
– actual values are read on the client by js
– js submit the calculated data to the server
this works perfectly, but it’s obviously “handmade” and not (as expected) automatically from the component;
so it’s not urgent anymore, but one probably expects to have the job done without “manual corrections” … maybe in one of the next versions?
thanks!

 

 

<!DOCTYPE html>
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<script type=”text/javascript” src=”smart.elements.js”></script>
<link rel=”stylesheet” type=”text/css” href=”smart.default.css” />
</head>
<body>
<div id=”content”></div>

<script language=javascript>

var objFormElements=
[
{
“dataField”: “Descrizione_I”,
“controlType”: “template”,
“label”: “Descrizione”,
“template”: “<input type=text size=50 maxlength=300 class=dataInput value=\”Advertising\”>”,
“labelPosition”: “”,
“name”: “Descrizione_I”,
“custom”: true
},
{
“dataField”: “Codice”,
“controlType”: “template”,
“label”: “Codice”,
“template”: “<input type=text size=20 maxlength=20 class=dataInput value=\”ADV\”>”,
“labelPosition”: “”,
“name”: “Codice”,
“custom”: true
},
{
“name”: “Tipologia”,
“dataField”: “Tipologia”,
“controlType”: “dropdownlist”,
“label”: “Visualizzazione”,
“controlOptions”: {
“dataSource”: [
{
“label”: ” “,
“value”: “0”
},
{
“label”: “Elenco magazine”,
“value”: “182”
},
{
“label”: “Home”,
“value”: “177”
},
{
“label”: “News”,
“value”: “179”
},
{
“label”: “Numero magazine”,
“value”: “183”
},
{
“label”: “Redazione”,
“value”: “178”
},
{
“label”: “Rubriche”,
“value”: “202”
},
{
“label”: “Standard”,
“value”: “181”
}
]
},
“labelPosition”: “”,
“custom”: true
},
{
“dataField”: “Link”,
“controlType”: “template”,
“label”: “Link”,
“template”: “<input type=text size=50 maxlength=300 class=dataInput value=\”\”>”,
“labelPosition”: “”,
“name”: “Link”,
“custom”: true
},
{
“dataField”: “Pos”,
“controlType”: “template”,
“label”: “Posizione”,
“template”: “<input type=text size=5 maxlength=5 class=dataInput value=\”\”>”,
“labelPosition”: “”,
“name”: “Pos”,
“custom”: true
},
{
“name”: “Tipologia_2”,
“dataField”: “Tipologia_2”,
“controlType”: “dropdownlist”,
“label”: “Autore”,
“controlOptions”: {
“dataSource”: [
{
“label”: ” “,
“value”: “0”
},
{
“label”: “test”,
“value”: “54”
},
{
“label”: “test ok”,
“value”: “46”
},
]
},
“labelPosition”: “”,
“custom”: true
},
{
“name”: “Tipologia_3”,
“dataField”: “Tipologia_3”,
“controlType”: “dropdownlist”,
“label”: “Rubrica”,
“value”: “1”,
“controlOptions”: {
“dataSource”: [
{
“label”: ” “,
“value”: “0”
},
{
“label”: “I personaggi”,
“value”: “1”
},
{
“label”: “I viaggi”,
“value”: “6”
}
]
},
“labelPosition”: “”,
“custom”: true
},
{
“dataField”: “-G2”,
“controlType”: “group”,
“columns”: 2,
“controls”: [
{
“dataField”: “is_Group”,
“controlType”: “boolean”,
“label”: “è un raggruppamento”,
“value”: false,
“labelPosition”: “”,
“name”: “is_Group”,
“custom”: true
},
{
“dataField”: “Inattivo”,
“controlType”: “boolean”,
“label”: “inattivo”,
“value”: false,
“labelPosition”: “”,
“name”: “Inattivo”,
“custom”: true
}
],
“labelPosition”: “”,
“name”: “-G2”,
“custom”: true
},
{
“name”: “SAVE”,
“label”: “salva”,
“controlType”: “submit”,
“labelPosition”: “”,
“dataField”: “SAVE”,
“custom”: true
}
];

var _tx=”<form name=’formTest’ id=’formTest’ action=’test.html’ method=GET></form>”;
document.getElementById(“content”).innerHTML=_tx;
var objForm=new Smart.Form(“#formTest”,{ controls: objFormElements });

</script>

</body>
</html>