Setting a Radio Button value using Javascript

After much research, I've figured out that the appropriate command to get the value of a Radio Button in APEX JavaScript is "html_RadioValue", but I haven't been able to figure out a command that will let you set the value of the Radio Button. Is there documentation on APEX's use of JavaScript that covers this issue?
Here's a simplified version of the script:
<script language="JavaScript" type="text/javascript">
function showval()
var item1 = html_RadioValue('P19_RADIO');
alert(item1);
//Reverse the current selection
if (item1 == 'Y') then
<mystery_statement> //set P19_RADIO to N.
else
<mystery_statement> //set P19_RADIO to Y.
</script>
I've tried the following, but none of them have worked:
- document.getElementById("P19_RADIO").value = 'N';
- document.getElementById("P19_RADIO").checked = 'N';
- $x('P19_RADIO').value = 'N';
- $x('P19_RADIO').checked = 'N';
Thanks.

Okay, that worked in the Oracle-hosted environment, but not in my development environment. Looking at the view/source output from each, it seems that the versions of APEX are different - my environment is using version 3.0.1.00.07.
The most obvious difference between the sources is the javascript includes at the top:
<script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script>
<script src="/i/javascript/apex_3_1.js" type="text/javascript"></script>
<script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script>
<script src="/i/javascript/apex_builder.js" type="text/javascript"></script>
vs.
<script src="/i301/javascript/htmldb_html_elements.js" type="text/javascript"></script>
<script src="/i301/javascript/htmldb_get.js" type="text/javascript"></script>
My fundamental question is: how does one learn Javascript, in the context of APEX? I can't find any documentation that explains what $v means, or what $x means, or what $s means.
Thanks.

Similar Messages

  • To Retrieve dynamic radio button values using jsp & javascript

    Hi All,
    How can i retrive the dynamically created radio button values and also want to get the clicked radio button values.I am using JSP and JAVA beans to retrive the values from the form. I dont have any probs to retrieve combo box values, text box values only problem showing with radio button values. If any data which is entered wrong in the form all the fields should prefills with the old value.Except radio button values all others fields such as combo box, text box values are prefilled with the old values.
    I have given the code for radios.
    document.write('<input type="radio" name="distradio" OnClick="sampleReq.fcidis.value=\'Y\'"/>Yes   ');
    document.write('<input type="radio" name="distradio" OnClick="sampleReq.fcidis.value=\'N\'"/>No');
    document.write('<input type="hidden" name="fcidis" value="">')
    <form method="POST" action="Update.jsp" name="sampleReq" >
    <tr>
    <td class="Txt_gris">
    <input type="radio" name="requester" OnClick="sampleReq.requester1.value='supplier'"/> supplier
    </td>
    <td class="Txt_gris">
    <input type="radio" name="requester" OnClick="sampleReq.requester1.value='customer'"/>customer
    </td>
    <td class="Txt_gris">
    <input type="radio" name="requester" OnClick="sampleReq.requester1.value='distributor'"/> distributor
    </td>
    <td class="Txt_gris">
    <input type="radio" name="requester" OnClick="sampleReq.requester1.value='employee'"/> employee
    </td>
    <td class="Txt_gris">
    <input type="radio" name="requester" OnClick="sampleReq.requester1.value='New partner'"/>New partner
    <input type="hidden" name="requester1" value=""/>
    </td>
    </tr>
    Advanced Thanks for help
    Regards
    Sona

    Hi,
    If you have this code
    document.write('<input type="radio" name="distradio" OnClick="sampleReq.fcidis.value=\'Y\'"/>Yes ');
    document.write('<input type="radio" name="distradio" OnClick="sampleReq.fcidis.value=\'N\'"/>No');
    document.write('<input type="hidden" name="fcidis" value="">')
    <form method="POST" action="Update.jsp" name="sampleReq" >
    <tr>
    <td class="Txt_gris">
    <input type="radio" name="requester" OnClick="sampleReq.requester1.value='supplier'"/> supplier
    </td>
    <td class="Txt_gris">
    <input type="radio" name="requester" OnClick="sampleReq.requester1.value='customer'"/>customer
    </td>
    <td class="Txt_gris">
    <input type="radio" name="requester" OnClick="sampleReq.requester1.value='distributor'"/> distributor
    </td>
    <td class="Txt_gris">
    <input type="radio" name="requester" OnClick="sampleReq.requester1.value='employee'"/> employee
    </td>
    <td class="Txt_gris">
    <input type="radio" name="requester" OnClick="sampleReq.requester1.value='New partner'"/>New partner
    <input type="hidden" name="requester1" value=""/>
    </td>
    </tr>
    this field distradio will not be able Update.jsp.
    You will need to insert these field into the form definition.
    Now, to get a valeu from a radio button, you need only to do request.getAttribute("fieldName").
    To generate dinamically all radio button values, i need to know where are these information? In database? If yes, you need to read the resultset na in value attribute you need to do somethink like this <input type=radio name=fieldName value="<%out.println(resultset.getString("FieldName"));%>">
    If you have more question, only send me a email,
    best regards
    Edney Imme
    [email protected]

  • How to set a form element value using javascript?

    Hello,
    I have been using the following two functions in AS 9.0.2 to set form values in javascript and it works correctly. However, the same code does not work in AS 10.1.2.0.2. Would appreciate if someone could let me know how to set form elements using Javascript(onchange of a field).
    function set_item_value(p_field_name, p_value)
    var v_index, v_full_name;
    for(v_index=0; v_index<document.forms[0].length; v_index++)
    v_full_name = document.forms[0].elements[v_index].name.split
    if (v_full_name[2] == p_field_name)
    document.forms[0].elements[v_index].value = p_value;
    function get_item_value(p_field_name)
    var v_index, v_full_name, v_return="";
    for(v_index=0; v_index<document.forms[0].length; v_index++)
    v_full_name = document.forms[0].elements[v_index].name.split
    if(v_full_name[2] == p_field_name)
    if(document.forms[0].elements[v_index].type != "radio")
    v_return = document.forms[0].elements[v_index].value;
    else
    if(document.forms[0].elements[v_index].checked)
    v_return = document.forms[0].elements[v_index].value;
    if(v_return == " ")
    v_return = "";
    return v_return;
    Thanks
    Dev

    This is not the best way to write JavaScript in Portal environment!
    You can't be sure that a form is the first in the html source!
    In Portal you change the order of your portlets, and also you can have several instances of the same portlet on the same page!!!
    You should use qualified form and field names!
    Please check the following JPDK methods:
    UrlUtils.htmlFormName
    HttpPortletRendererUtil.portletParameter

  • How to get radio button value in JavaScript

    I have a very simple radio button with two values: 1 and 2. I am trying to pass the value using a JavaScript call to a popup window. I am assuming there is a different method of obtaining the value, as
    var v_typ = document.getElementById("P1520_TYPE").value;doesn't work.

    Hi,
    If you are on Apex 3.x or higher, use JavaScript API function $v
    http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/javascript_api.htm#CHDEJEIG
    var v_typ = $v("P1520_TYPE");Regards,
    Jari

  • Setting/Clearing Dynamic Radio Button values

    Hi, i have the following Radio buttons defined within an iteration
    <c:forEach items="${searchresults}" var="post" varStatus="status">                                        
         <tr class = "text_results"> 
              <c:url value="/searchposts.do" var="url">
                   <c:param name="postitle" value="${post.postId.postTitle.title}"/>
                   <c:param name="postcode" value="${post.postId.postTitle.code}"/>                    
                   <c:param name="unitcode" value="${post.postId.units.unitCode}"/>
                   <c:param name="auth" value="${post.postId.auth}"/>
              </c:url>
              <td>
                   <a href='<c:out value = "${url}" />'>                                        
                   <c:out value="${post.postId.postTitle.title}"></c:out></a>
              </td>
              <td><c:out value = "${post.mustering}"/></td>  
              <td><c:out value = "${post.rank}"/></td>  
              <td>
                   <html:radio property="incmbt" 
                        value='${post.postId.postTitle.title}'>
                   </html:radio>                                             
                   <a href = "javascript:unCheckRadio(document.searchForm.incmbt)">
                        clear
                   </a>
              </td>                                             
         </tr> 
    </c:forEach>  The property "incmbt" is declared as a form property (String incmbt) with its getters and setters ... i plan to set each radio button with a value from database within an object called post. The actual value to set for each radio is a post title ... I seem to be getting a NULL value when i try to get the value in action class (form.getIncmbt() yields null) ... Am i assigning the value correctly?
    Further, here's is how i clear the values which seems to work
    Javascript
    function unCheckRadio(btngrp) {     
         for(var i=0; i < btngrp.length; i++)
              if( btngrp.checked == true ) {
                   btngrp[i].checked = false;
                   document.write("Selected Radio is :" + btngrp[i].value);
    But the "Selected Radio is :" displays "${post.postId.postTitle.title}", not the actual post title... ???

    I just thought about this quickly, i think its because an href link does not submit form values ... If so, how can i submit the value of a radio button through the <c:param/> tag or any other way after clicking the href link to submit the form?

  • 2 sets of Radio Buttons in a Form-complications

    Hello everyone,
    I have been looking around for code to assist me in building a form. I have developed the form, and just have a couple problems that I can't figure out.
    In one question on the form the user can choose from one set of radio buttons and select one of the five options. Then I have a second set of radio buttons, that the user can again only choose one option. My problem is that I only want the user to be able to select from the second set of radio buttons if they selected a certain option in the first set. An example to clear up my problem:
    Did you finish the training:
    Yes
    Half
    None
    So if the user selected yes from the first set of radio buttons, I want the second set of radio buttons to now be selectable:
    The training was:
    Up-beat and enjoyable
    Snoozer
    The conditions that I am using are very different than these but this is just a simple skit. So how do I make the second set of radio buttons unselectable until the user selects a specific radio button from the first set of radio buttons.
    Thanks, I really appreciate the help!

    If you have a radio button exclusion group called 'completion' with three items 'Yes','Half', and 'None' and a second radio button exclusion group called 'completion', go to the 'feedback' Value tab and set the type to 'readOnly'.
    Add the following script to the 'completion' change event...
    // form1.page1.subform1.completion::change - (JavaScript, client)
    if (this.rawValue == "Yes") {
      form1.page1.subform1.feedback.access = "";
    else {
      form1.page1.subform1.feedback.access = "readOnly";
      form1.page1.subform1.feedback.rawValue = "";
    If the user selects 'Yes', the 'feedback' group is available for selection. If the user does not select 'Yes', 'feedback' is reset and made readOnly.
    Steve

  • Passing radio button values to the backing bean

    Hi all,
    I need help with passing group of radio button values to a backing bean. I have page which has a dataTable to display a list of alerts. For each alert there are two radio buttons (YES & No) to indicate whether the email option for each alert is set or not. Now when i change the radio buttons and click on a submit button i should be able to pass these radio button values into action method in which i need to update the alerts. This is my code
    <h:form>
    <t:dataTable id="sub"
                       var = "alert"
                       value =#{subscriberBean.alertsList}">
    <t:column>
    <h:outputText value="#{alert.name}" />
    </t:column>
    <t:column>
    <h:selectOneRadio id="subscriptions" value="#{alert.sendEmail}">
      <f:selectItem id="item1" itemLabel="Yes" itemValue="0" />
      <f:selectItem id="item2" itemLabel="No" itemValue="1" />
    </h:selectOneRadio>
    </t:column>
    <t:dataTable>
    <h:commandButton id="button1" value="Save changes" actionListener="#{subscriberBean.updateAlert}" />
    </h:form>
    {code}
    I tried to to do something like below and get the updated list in the action event in the backing bean but it didn't work.
    {code}
    <h:commandButton id="button1" value="Save changes" actionListener="#{subscriberBean.updateAlert}" >
    <f:attribute name="alerts" value="#{subscriberBean.alertsList}"/>
    </h:commandButton>
    // Backing Bean
    public void updateAlert(ActionEvent e){
    List<Alert updateList = (List<Alert>)event.getComponent().
                    getAttributes().get("alerts");
    {code}
    Can someone advise how to get these update radio button values in my actionListener method.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    The value the user selected will be written to the sendEmail property of the managed bean named alert. We know this because you set the value attribute to #{alert.sendEmail}. So simply access the managed bean in your action method.

  • Set of Radio Buttons in a page

    Hi,
    I am new to OAF. My use case is to create a page with set of 'Yes/No' questionnaires. So, there will be set of radio buttons associated with each questions.
    Please guide me to achieve this in OAF.

    Hi,
    You can create the radio button in processRequest by using (OAMessageRadioButtonBean)webBean.createbean()
    Also, check if this link can help u : http://oracleanil.blogspot.in/2009/04/radio-group-event.html
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Change Data Entry Template variable values using javascript

    Content ServerIs there a way to change the Data Entry Template's text/Integer variable values using javascript?

    I believe you're asking if you can change the value of a content item's property using Javascript (a content item is created from a data entry template, which defines the set of properties).
    Unfortunately there is not a way to permanently change it in the content item, since Javascript is executed client-side rather than on the server. However, if you're just interested in how the value is displayed in the published HTML, you could modify the presentation template to store the property value into a Javascript variable and then manipulate it to be displayed in whatever manner you wish.

  • Disable a set of radio buttons

    Hello Experts,
    I have written a code in which there are two set of radio buttons.
    In first set there are three radio buttons.
    p_range    RADIOBUTTON GROUP rbg DEFAULT 'X',
    p_date      RADIOBUTTON GROUP rbg,
    p_comp     RADIOBUTTON GROUP rbg.
    In second set there are 10 radio buttons.
    I need to write a code in a way that if user selects the third radio button from first set p_comp, then few of the radio buttons from the second set should grey out.
    Please help me with some sample code.
    Would definately reward if the code is useful.

    Alternatively you can also use MODIF ID's for the radio buttons to do the same.
    You can get the syntax on the F1 help...
    Cheers,
    Tatvagna.
    Eg.
    p_1 RADIOBUTTON GROUP rb2 DEFAULT 'X' modif id r1,
    p_2 RADIOBUTTON GROUP rb2 modif id r1,
    p_3 RADIOBUTTON GROUP rb2 modif id r1,
    p_4 RADIOBUTTON GROUP rb2 modif id r3,
    p_5 RADIOBUTTON GROUP rb2 modif id r1,
    p_6 RADIOBUTTON GROUP rb2 modif id r1,
    p_7 RADIOBUTTON GROUP rb2 modif id r2,
    p_8 RADIOBUTTON GROUP rb2 modif id r2,
    p_9 RADIOBUTTON GROUP rb2 modif id r2,
    p_10 RADIOBUTTON GROUP rb2 modif id r1.
    And then do
    Loop at screen.
           IF screen-group1 IS NOT INITIAL AND
            NOT  screen-group1 EQ 'R1' .
              screen-active = '0'.
              MODIFY SCREEN.
           ENDIF.
    endloop.

  • How do I save preferences/values using javascript in dashboard widget?

    How do I save preferences/values using javascript in dashboard widget? I apologize if this is a stupid question but I simply cant seem to find a way. For example, if on teh back side of the widget teh user chooses the color of the widget, where or how do I save that value so it is retained the next time the user goes to the dashboard. Also, once saved, how do I read the value?
    Thanks a mil....

    Please look into
    /Developer/Examples/Dashboard/Goodbye World/3-Saving Preferences directory for a comple example.
    Otherwise, wait until the following book is published :-))
    http://www.apress.com/book/bookDisplay.html?bID=10173
    Mihalis.

  • Change the value of a SharePoint List lookup control value using javascript

    hi,
    could you please help in changing the value of a SharePoint List lookup control value using javascript.
    Please note that i have to change the lookup value which is in the form of a drop down from the infopath form.
    Thanks

    https://stackoverflow.com/questions/5678210/select-dropdown-menu-option-with-javascript
    Does that help?

  • Sets of Radio buttons all grouped together

    I am creating a form with many sets of radio buttons. Each set contains 3 buttons. When I add the 4th button, Designer groups it with the first three. When I add a 5th button, it is automatically grouped with the first 4. I need to separate the buttons into groups of 3. How do I manually choose which radio buttons to group together?
    Eric

    Doing this is little tricky... Add all your radio buttons and then choose all the ones you want to group in a different set holding Ctrl key. And then click your mouse button (right). Then choose 'Wrap in New Radio Button Group'.
    Good luck,
    SekharN.

  • How to Set "DateOnly" property in DateTimeControl using Javascript.

    How to Set "DateOnly" property in DateTimeControl using JavaScript.

    Is there any specific reason you want to set it through JavaScript ? You can directly set the DateOnly property in the markup itself.
    <SharePoint:DateTimeControl runat=server id="dtControl" DateOnly="true"></SharePoint:DateTimeControl>
    Please can you elaborate on what exactly is the requirement for setting this through javascript?
    Geetanjali Arora | My blogs |

  • How to give the radio button value dml statement

    Oracle Forms6i
    Hai All
    I have created a form I the form i have created two radio button and named as appr, Recmd when i execute the forms appr is marked by default
    So now i need to insert or update this radio button value in my Table
    how can i insert or update this radio button value
    pls tell me the steps to do
    Thanks In Advance
    Srikkanth.M

    Hi,
    :<your_radiogroup_name> will give the selected radiobutton value

Maybe you are looking for

  • Contextual event in reverse direction ( from child TF to parent view )

    Hi , It seems all example of Contextual events talk about mirroring input value from Parent page to Child TF running in a region and there are numerous examples out there. What I wanted to accomplish was that an lov in a child TF triggers a contextua

  • De-authorization of all computers

    I am having issues with de-authorization of my 5 computers. Every time when I tried to do that, it gives me an error stating that I have to wait until Dec. 20, 2010 in order to do that. Does anyone know how I can do this today instead of waiting unti

  • How DMR can be maintained for MATERIAL AND VENDOR LEVEL

    Hi, For now we implemented the DMR only at material level, but now we want to know if it is possible to implement the same at material and vendor level, because some material are provided by different vendors and we want to apply a different DMR for

  • Lost checked selection

    First post! While checking some recently added songs I managed to loose all my checked selection. I took me days to go through thousands of songs and checked my favorites. I still have all my songs (unselected) in my iTunes and all my selected songs

  • Set permissions for everyone to edit text on a website (Was: Editi text)

    How do i site my site up so any one can editi the text on the site