How to display a text field if yes selected in radio button

Does anyone know how to hide/show a text field based upon a
radio button selection? What I want to do is ask a question with
yes or no as radio buttons. Then, if the user selects "YES" I want
to display a required text field. If the user click no, there isn't
a need for the text field.

Try this...
<html>
<head>
</head>
<script>
function ShowField(){document.MyForm.MyField.style.display =
"inline";}
</script>
<body>
<form name="MyForm">
<input type="radio" name="MyCheckBox"
onClick="ShowField()">
<input type="text" style="display: none"
name="MyField">
</form>
</body>
</html>

Similar Messages

  • How to set "Display as Text" field with AJAX select list

    thanks Denes for your posting. I'm trying to use the Denes Kubicek code to populate a "Display as Text" field. It works for Text Field (disabled), but not "Display as Text" field(saves state) . In my applciation I need to show this field only (not the disabled text box) when a select list value is changed. any ideas to modify the code below are appreciated.
    http://htmldb.oracle.com/pls/otn/f?p=31517:80:3418128396960418::NO
    here is the code from the url above
    1. Create an Application Process - getDet:
    DECLARE
    my_det VARCHAR2 (200);
    BEGIN
    SELECT ename || CHR(10) || job || CHR(10) || mgr
    INTO my_det
    FROM emp
    WHERE empno = :P80_EMPLOYEES;
    HTP.prn (my_det);
    END;
    2. Put the following in the Region Header of your page:
    <script language="JavaScript" type="text/javascript">
    function f_getDet ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
    get.add('P80_EMPLOYEES',html_GetElement('P80_EMPLOYEES').value)
    gReturn = get.get();
    if(gReturn)
    {  html_GetElement('P80_DETAILS').value = gReturn  }
    else
    {  html_GetElement('P80_DETAILS').value = 'null'  }
    get = null;
    </script>
    3. Put the following in the HTML Form Element Attributes of :P80_EMPLOYEES:
    onChange="f_getDet()";

    Arie,
    this works fine on normal page, except page zero. I have the AJAX select list and "Display as Text" field on page zero. The "Display as Text" field doesn't show the the value when AJAX select is changed. I'm using similar code as used in my other APEX page on OTN site. I tired to display the gReturn value, just before calling "setDisplayOnlyNode" function in the code below and it's showing correct value, but fails to display the value in the APEX field on page zero. Any ideas are appreciated.
    Thanks,
    Surya
    <script language="JavaScript" type="text/javascript">
    function setDisplayOnlyNode(pItem, pValue)
    { var textNode = pItem + '_DISPLAY'; $x(textNode).innerText = pValue; }
    function f_getDet ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
    get.add('P1_EMPLOYEES',html_GetElement('P1_EMPLOYEES').value)
    gReturn = get.get();
    if(gReturn)
    { setDisplayOnlyNode('P1_DETAILS',gReturn)}
    {  html_GetElement('P1_TEST').value = gReturn  }
    get = null;
    </script>

  • How to display a text field entries as *?

    Hello all
    I'm developing a login in form with username and password fields,i want to display the entries of password field during the run time as ****?
    for this any option in property pallet to that related field?
    for ex:
    password abcdef
    during runtime if i enter the password abcd i want loke this
    Password ****
    How to make this?

    hi
    select or hightlight the same password field
    and press F4 and check for conceal data set to yes.and check hope this helps u.
    sarah

  • Using a text field as well as a display as text field on a form

    I have a text field that a user will enter in an employee id and from there it will populate a display as text field with their first and last name. I am trying to accomplish this using a javascript process but can not get the name to display. This does work if i change the display as text field to a select list. Can someone tell me what im doing wrong? Thanks
    My code is below:
    Application Process
    DECLARE
    v_desc VARCHAR2(255);
    BEGIN
    SELECT last_name||','||first_name
    INTO v_desc
    FROM org1
    WHERE radionum = :P2_technician1_radio;
    htp.prn(v_desc);
    END;
    HTML Form Attributes for p2technician1_radio_
    onblur="set_Item();"
    Javascript in HTML header
    <script language="JavaScript" type="text/javascript">
    <!--
    function set_item(pValue){
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Item',0);
    if(pValue){
    get.add('P2_TEMP_APPLICATION_ITEM',pValue)
    }else{
    get.add('P2_TEMP_APPLICATION_ITEM','null')
    gReturn = get.get('XML');
    if(gReturn){
    var l_Count = gReturn.getElementsByTagName("item").length;
    for(var i = 0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("item");
    var l_ID = l_Opt_Xml.getAttribute('id');
    var l_El = html_GetElement(l_ID);
    if(l_Opt_Xml.firstChild){
    var l_Value = l_Opt_Xml.firstChild.nodeValue;
    }else{
    var l_Value = '';
    if(l_El){
    if(l_El.tagName == 'INPUT'){
    l_El.value = l_Value;
    }else if(l_El.tagName == 'SPAN' &&
    l_El.className == 'grabber'){
    l_El.parentNode.innerHTML = l_Value;
    l_El.parentNode.id = l_ID;
    }else{
    l_El.innerHTML = l_Value;
    get = null;
    //-->
    </script>
    Edited by: Dclipse03 on Dec 1, 2008 9:48 AM

    Javascript:
    <script language="JavaScript" type="text/javascript">
    <!--
    function pull_value(pValue){
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Item',0);
    if(pValue){
    get.add('P2_TEMP_APPLICATION_ITEM',pValue)
    }else{
    get.add('P2_TEMP_APPLICATION_ITEM','null')
    gReturn = get.get('XML');
    if(gReturn){
    var l_Count = gReturn.getElementsByTagName("item").length;
    for(var i = 0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("item");
    var l_ID = l_Opt_Xml.getAttribute('id');
    var l_El = html_GetElement(l_ID);
    if(l_Opt_Xml.firstChild){
    var l_Value = l_Opt_Xml.firstChild.nodeValue;
    }else{
    var l_Value = '';
    if(l_El){
    if(l_El.tagName == 'INPUT'){
    l_El.value = l_Value;
    }else if(l_El.tagName == 'SPAN' &&
    l_El.className == 'grabber'){
    l_El.parentNode.innerHTML = l_Value;
    l_El.parentNode.id = l_ID;
    }else{
    l_El.innerHTML = l_Value;
    get = null;
    //-->
    </script>
    Setitem Process:_
    DECLARE
    v_technician1_name VARCHAR2 (200);
    CURSOR cur_c
    IS
    SELECT last_name||','||first_name d,last_name||','||first_name r
    FROM org1
    WHERE radionum = v('p2_TEMP_APPLICATION_ITEM'));
    BEGIN
    FOR c IN cur_c
    LOOP
    v_technician1_name := c.technician1_name;
    END LOOP;
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="P2_technician1_name">' || v_technician1_name || '</item>');
    HTP.prn ('</body>');
    EXCEPTION
    WHEN OTHERS
    THEN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="P2_technician1_name">' || SQLERRM || '</item>');
    HTP.prn ('</body>');
    END;

  • How to add new text field in standard report

    how to add new text field in standard report?

    Hi,
    I presume you are talking about a report display in ALV and u wish to add a column to it .
    If it is a global requirement ,as in table being used there in ALV can be modified, then you can append the table and the system should pick up the same automatically from there.
    Otherwise , you can make a Z program . Modify the catalog being used in ALV.
    Regards,
    Shweta

  • How to populate the TEXT field in MIGO

    Hi folks,
    While creating material document in MIGO or MB01, i am inserting some data in TEXT ( Field in line item level ). This text data is disappearing , once mat doc is created.
    how to populate the TEXT field in MIGO?Is there any cusomisation?it's urgent .
    Regards
    pabi

    Hello Pabitra,
    I had a similar issue in my Project.
    Please verify if the SMOD enhancement MBCF0002 (EXIT_SAPMM07M_001) is active in your system.
    If this is the case, verify from two angles:
    a) Whether the Enhancement was accidentally activated - If yes, then De-activate the same
    b) If there is some logic coded in the User Exit, but, the Text is somehow not determined...even the existing content in the text field (input to EXIT_SAPMM07M_001) will get vanished.
    Hope that your problem will be resolved by this.  Pls reward points.
    With Regards
    Vijay Gajavalli

  • HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS

    HI,
       HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS?

    in ur script main window
    /: IF &TTXSY-PAGE& = 15.              
    ur text or standard text           
    /: ENDIF.                             
    use this.
    hope it helps if any issues revert back

  • How to collapse unused text field in PDF form

    Hi all, may i know how to collapse unused text field in a PDF form. Etc, we have alot of description line for user to enter the info, but some line will be left unused, so i was wondering whether can i hide those unused text field. But when i need them, i just expand it and use it.

    I don't think w/o UI Customization it is possible.
    UI customization won't be a small one as it is a common wizard and used at multiple places. So it will be a huge work.

  • How to validate an text field item using javascript for numbers only.

    hi,
    how to validate an text field item using javascript for numbers only.please help me on this urgent
    please mail me solun if posible on [email protected]

    Hi,
    Page HTML header
    <script>
    function onlyNum(evt) {
      // Usage: onKeyPress="return onlyNum(event)"
      evt = (evt) ? evt : window.event;
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        var status = 'This field accepts numbers only!';
        alert(status);
        return false;
      var status = '';
      return true;
    </script>Item HTML Form Element Attributes
    onKeyPress="return onlyNum(event)"Br,Jari

  • How to disable a text field

    Hi experts,
    I have a req. in which I have designed a selection screen.
    Now there are 2 radio buttons namely ALV n Excel.
    Below that, there is another text box called Path.
    My req. is that only when the user selects the radio button Excel, the Path field should
    get enabled.
    How can I achieve this functionality?
    Below is the piece of code where I have declared the buttons.
    SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
    PARAMETERS: S1 RADIOBUTTON GROUP RAD2 DEFAULT 'X',
                S2 RADIOBUTTON GROUP RAD2.
    SELECTION-SCREEN: end OF BLOCK b4.
    SELECTION-SCREEN: BEGIN OF BLOCK b5 WITH FRAME TITLE text-005.
    PARAMETERS: p_path LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN: END OF BLOCK b5.
    Thanks,
    Ajay.

    hi ajay,
    SELECTION-SCREEN : BEGIN OF BLOCK B1 .
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : P_RB1 RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND AC,
                 P_RB2 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : P_FILE TYPE RLGRAP-FILENAME MODIF ID ZFI.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN : END OF BLOCK B1.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN .
    *-- if radio button from excelsheet is selected
        IF P_RB2 = 'X'.
          IF SCREEN-GROUP1 = 'ZFI'.
            SCREEN-ACTIVE = '1'.
          ENDIF.
          IF SCREEN-GROUP1 = 'ZF1'.
            SCREEN-ACTIVE = '1'.
          ENDIF.
    *-- if radio button from database is selected
        ELSEIF P_RB1 = 'X'.
          IF SCREEN-GROUP1 = 'ZFI'.
            SCREEN-ACTIVE = '0'.
          ENDIF.
           IF SCREEN-GROUP1 = 'ZF1'.
            SCREEN-ACTIVE = '0'.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    regards
    Gaurav

  • How to rotate a Text Field?

    Is there anyone who knows how to rotate a Text Field? I just need to move some degrees (for example: clockwise).
    Thanks in advance for any help you can provide

    You can onlt rotate it in 90 degree imcrements ...this is controlled on the
    layout tab next to the anchor setting.
    Paul

  • How to Display key/text in default selection screen?

    HI Gururs,
    I want to display key/text in variable default selection screen in BI Analyzer in Quality.
    please give me any suggestions to resolve this.
    Thanks
    vadlamudi

    hi,
    What i have done is in the cube level, in the dimensions i have made specific properties and set to key/text in development, so its working fine in development of the analyzer, but still its showing text only in quality analyzer.
    please give me the solutions if you know any.
    regards
    vadlamudi

  • Dynamic Select List / Radio Buttons triggering conditional display of field

    Hi HTMLDB Team,
    I wanted to mimic this very nice and useful HTMLDB 'select list feature' at the HTMLDB "Create Application ... from Application Export file " ... option .
    ie when you hit the form that asks you to "install the application", i,e
    Builder - Application >Export Import>Export Repository>Install Application
    you have the the following radio Options :
    Install As Application
    X Reuse Application ID 401 From Export File
    X Auto Assign New Application ID
    X Change Application ID
    New Application
    The "New Application ID" field appears only when I select "Change Application ID" radio option. That great and that's exactly what I want.
    How do you do that ?
    I am currently using a select list instead of radio list. It's the same thing ... I
    I tried " many options of the "select list with redirect .... with submit .... but I was not successfful. All I am trying to achieve is to offer a list of departments ... but when the user select "other", I want to show a text field for the user to type in the "other Department" ... without losing what I had already entered in the form previously and without actually Submitting the form . I still have other fields to enter after the select list .
    Is that possible with pure HTMLDB ?
    Or do I have to craft up some Javascript .
    I'd prefer pure HTMLDB .. I do not want to use javascript, to avoin a maintenance nightmare once I submit the code to other developers ...
    Can you pls help ?
    Thanks a lot.

    Hello,
    Take a look at these built in javascript function
    they should give you what you want.
    http://htmldb.oracle.com/pls/otn/f?p=11933:39
    CarlCarl,
    if I understand it right, these functions are already built in Apex 2.2.1.
    I need to show an item with label when user selects certain radio button. This sounds like the opposite to f_Hide_On_Value_Item_Row function.
    Can this task be done with apex built-in javascript functionality at this moment?
    Thanks

  • How to display the sort value in the selection screen in the report title

    Dear All,
    How to display the sort value in the selection screen in the report title? I have selected a value in the selection screen for sorting , but i need that values by which i have sorted with in the report title. Can you please throw some light on this!!
    Good day,
    Thanks and regards
    Arun S

    Hi Arun,
    Try this.
    1, Set one dynamic parameter,
    2, Drag and drop that parameter into  your report title.
    3, Pass the value(sort value) dynamically from your application,
    4, Cheers..
    Other wise Try with Dataset, create a dataset and fill thev alue into that.. Then  set the data source from CR designer. and darg and drop that data column into the report.
    Hope this will work,
    Regards,
    Salah
    Edited by: salahudheen muhammed on Mar 25, 2009 11:13 AM

  • How do I create a group of two yes or no radio buttons?

    Want to create about seven groups of 2 yes or no radio buttons. The client can click one, but not the other.

    Just create two radio buttons, give them the same name, but different
    export values.
    Copy & Paste to create more groups, but remember to rename the fields in
    each group.

Maybe you are looking for

  • Checkboxec on selection-screen

    hi frens, i have 3 checkboxes on selection-screen. 1st one-should be already checked and grey 2- unchecked 3-checked so when i check the 2nd one. 1st-checked and ungrey 2-checked 3-ckecked and ungrey

  • Cannot instance a object

    I have a problem. I cannot instance a object of my own class, anytime I try this my pc is hanging up it`s self. (The class is a little bit long for posting here and i do not have any idea were the mistake is.) Edited by: Michroe on Feb 2, 2009 7:34 A

  • Distorted Files when converting from Excel to PDF

    Hello, I work in IT and I have an annoying issue that when someone using Excel 2007 clicks on the acrobat tab to create a PDF from excel. The finished PDF file is distorted, and will not show the files as they should be. Part of the graph will be mis

  • I need help I want to analyze and create reports using data from my firefox history files .

    I am not quite sure where to post this. I had a program for analyzing my firefox history which no longer works due to the change in how firefox stores history data. I am not an sqlite user. Any help will be greatly appreciated. I downloaded the sqlit

  • Image transform over network

    I used following code for JPG image transfer sender : Socket client=new Socket("localhost",4444);            FileInputStream fis = new FileInputStream("C:/abc.jpg");           byte[] buffer = new byte[fis.available()];           fis.read(buffer);