Demo – dva formuláře
Použití dvou formulářů pro zadávání firem na jedné stránce.
Vstupní políčka, která patří k sobě, propojíme přidáním identifikátoru do atributu class
u input
elementů. Identifikátory musí začínat na „smartform-instance
“. Více najdete na stránce Základní postupy.
První firma
Druhá firma
Zdrojový kód – JavaScript
<script type="text/javascript" src="https://client.smartform.cz/v2/smartform.js" async></script>
<script type="text/javascript">
var smartform = smartform || {};
smartform.beforeInit = function () {
smartform.setClientId('[clientId]');
}
</script>
Zdrojový kód – HTML pro první firmu
<form>
<div>
<div ><label for="smartform_nazev_1">Název firmy</label> <input class="smartform-instance-1 smartform-company-name" id="smartform_nazev_1" type="text" /></div>
<div ><label for="smartform_ico_1">Obec</label> <input class="smartform-instance-1 smartform-company-registration-number" id="smartform_ico_1" type="text" /></div>
<div><label for="smartform_dic_1">PSČ</label> <input class="smartform-instance-1 smartform-company-vat-number" id="smartform_dic_1" type="text" /></div>
</div>
</form>
Zdrojový kód – HTML pro druhou firmu
<form>
<div>
<div ><label for="smartform_nazev_2">Název firmy</label> <input class="smartform-instance-2 smartform-company-name" id="smartform_nazev_2" type="text" /></div>
<div ><label for="smartform_ico_2">Obec</label> <input class="smartform-instance-2 smartform-company-registration-number" id="smartform_ico_2" type="text" /></div>
<div><label for="smartform_dic_2">PSČ</label> <input class="smartform-instance-2 smartform-company-vat-number" id="smartform_dic_2" type="text" /></div>
</div>
</form>