APEX-AT-WORK no image

Get radio button value with javascript

Von Tobias Arnhold 5.13.2010
Most of you know how to get an HTML session value inside APEX:
  $x('P1_NAME').value
To get the current value from a radio button use this APEX function:
  $f_ReturnChecked('P1_DEPARTMENT')

// 1. Item: HTML Form Element Attributes:
onChange="javascript:fnc_setRadioItem('P1_DEPARTMENT')";

// 2. Page: HTML Header
<script type="text/javascript">
function fnc_setRadioItem(v_radioItem)
{
// Create AJAX request object with JavaScript class "htmldb_Get"
// 1. Parameter: Appointed for 'Partial Page Refresh', not needed
// 2. Parameter: Determined the actual application ID
// 3. Parameter: Defines the application process, I use a dummy value
// 4. Parameter: For 'Partial Page Refresh': not needed
var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=v_dummy',0);
get.add(v_radioItem,$f_ReturnChecked(v_radioItem))
gReturn = get.get();
//html_GetElement(v_radioItem).value = v_radioItem;
get = null;
}
</script>

You can find even more functions inside the APEX documentation: API Reference - 9 JavaScript APIs

Tip für die deutsche Community: APEX AJAX und JQuery HowTo Beispiel

Post Tags: