# フォームパラメータの使用

## デザイナーでのフォームパラメータを設定

データ情報タブビューで**OZFormParam**を右クリックし、**パラメータ設定**を選択してパラメータを追加します。 その後、以下の図のようにmemberNoおよびfirstNameのTextBoxにパラメータ値を割り当てます(ドラッグ・アンド・ドロップ)。

![](https://1097513732-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwWWN-Gla4aA9ONdCK6%2F-LxxlBKx4JVvZGB6Uli0%2F-LxxlYeE5LFu7_CeTfL8%2Flearn-eform-app2ozr-formparam.png?alt=media\&token=4358a0cb-7b6a-42df-85c1-46c44aaaa1c8)

Gender項目を設定するには、**male**と**female**のRadioButtonの**OnBind**イベントに以下のスクリプトを書き込みます。

```javascript
// for "male"
if (This.GetDataSetValue("OZFormParam.gender") == "M") { 
	This.SetChecked(true);
}

// for "female"
if (This.GetDataSetValue("OZFormParam.gender") == "F") { 
	This.SetChecked(true);
}
```

**bandAgree**バンドの表示を非アクティブにするには、**bandAgree**の**OnBind**イベントに以下のスクリプトを書き込みます。

```javascript
if (This.GetDataSetValue("OZFormParam.bandAgree") == "false") {
	This.SetInvisible(true);
}
```

## パラメーター値の送信

以下のようにHTMLでOZ Formパラメーターに値を渡します。

```javascript
<script type="text/javascript" >
var serverUrl = "https://" + location.host;
function SetOZParamters_OZViewer(){
	var oz = document.getElementById("OZViewer");
	oz.sendToActionScript("information.debug", "true"); // viewer console
	oz.sendToActionScript("connection.servlet",serverUrl + "/oz/server");
	oz.sendToActionScript("connection.reportname","/eform/membership.ozr");
	oz.sendToActionScript("connection.pcount", "4");
	oz.sendToActionScript("connection.args1", "memberNo=" + "1001");
	oz.sendToActionScript("connection.args2", "firstName=" + "John Michael");
	oz.sendToActionScript("connection.args3", "gender=" + "M");
	oz.sendToActionScript("connection.args4", "bandAgree=" + "false");
	return true;
}
start_ozjs("OZViewer", serverUrl + "/oz/HTML5viewer/");
</script>
```

[Run example](https://demo.ozeform.io/oz/eform/membership-formparam.html)
