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

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

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

![](/files/-LxxlYeE5LFu7_CeTfL8)

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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jp.ozeform.io/bjonbakkuappu/oz-viewer-study/fmuparamta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
