Hello,
I'm an APEX beginner with the first APEX application. This app has a page 22 to enter edge information for a graph. There are two text input fields P22_LINK_NODE_A, P22_LINK_NODE_B.
Sometimes it's needed to toggle (swap) the values of these two fields.
To achieve this I've added an HTML button "toggle_A_B" and a Javascript function.
But ... it's not doing what it's expected to do :(
Clicking on the button seems to submit the page to the server, although this shouldn't be the case.... and the values of the text fields P22_LINK_NODE_A, P22_LINK_NODE_B don't change.
I've expected that everything happens just on the client side.
Is it normal that the browser tries to submit the page?
Do I need to implement something on the server side? (processes, branches,...)
The HTML button "toggle_A_B" has Button attribute: onclick="toggleNodes();"
The button's Optioanl redirect is set to "no target". (behavior is the same with "redirect to page 22")
In the page's "HTML Header" there is the following Javascript function (which works find in a non-Oracle-APEX HTML page).
<script type="text/javascript" language="JavaScript">
function toggleNodes() {
var x = document.getElementById("P22_LINK_NODE_A").value;
var y = document.getElementById("P22_LINK_NODE_B").value;
document.getElementById("P22_LINK_NODE_B").value = x;
document.getElementById("P22_LINK_NODE_A").value = y;
}
</script>
There's a forum post with a similar topic, maybe I should also use this $s( ) approach?
2809082
Regards,
Roman