Using JavaScript to show/hide fragments

Hi,
Can anyone point me in the direction of information or an example of JavaScript being used to show or hide fragments within a form?
I'm looking to add JavaScript to the XDP content of my fragments so that these fragments will be shown or hidden depending on the evaluation of certain conditions.
If I create a form, and reference a fragment within that, then I can hide the fragment using this JavasScipt embedded within the form:
xfa.form.MyForm.MyForm.MyFragment.presence="hidden"
However, I'm looking to add the JavaScript to my fragment. I've used similar JavaScript but when the form and fragment are assembled the fragment is always displayed.
Can anyone help here please?
Thanks,
Ray.

Hi,
Can anyone help here at all?
All that I need for now is how to get JavaScript included in my fragment invoked when a form that includes that fragment is assembled.
When the fragment is rendered by itself the JavaScript is invoked. But not when it's rendered from within another form. Why is this?
Thanks,
Ray.

Similar Messages

  • Captivate: Using Javascript to show/hide text captions

    Hello,
    I want to show/hide a text caption using javascript. I can't find the way of doing it with advanced actions. I dont know if it's because it belongs to a question slide in a pool. Does somebody knows if it's possible and how it can be done??

    You can set the length of the variable when you insert it.
    15 characters is just the default setting.
    What I meant by COULD is that the kind of thing you are asking about here (using JavaScript to hide objects inside a Captivate movie at runtime) is not as simple as you'd like it to be.
    JavaScript is not my particular area of expertise, but there are some people that chime in on this forum that ARE experts at JS. But I think they would also be the first to say that it's not as simple a thing to pull off as just "knowing the command to hide/show an object".
    The easiest tool to use in Captivate for showing or hiding objects is Advanced Actions.  The next easiest thing to use is ActionScript 3, and that's hard.  JavaScript is a very useful programming language, but it spends all of its life outside the Captivate movie looking in through AS3's External Interface.  So JS alone is not going to solve all your issues.

  • How hard is it to use javascript to show/hide fields. Is it easier to use the action builder?

    I know nothing about javascript and all that ive been using so far has been stuff ive found on here (thank you everyone).
    Using the action builder seems like its gonna be very tedious to do since i have so many subforms that hide, would it be esier to use javascript?

    I know nothing about javascript myself but I just created a form with about 10 different subform that show or hide depending on what the user chooses from a drop down list and I used Action Builder. If we don't know javascript, how can we use it? But Action Builder did a fine job of hiding/showing wherever I needed it. And Action Builder can do more than one thing by clicking that + sign when you are building an action.
    For instance, I needed to place a button in each subform that would close both the field that the person was working in and also the subform on the next page where the information was going into floating fields in a text block that was only visible thru a drop down list text select. I could have never figured out how to do that based on my knowledge of javascript. Thank Adobe for including Action Builder in this version of LiveCycle and I use it all the time. I find it extremely easy to use but it takes a little mental training to think thru the steps of how you can use the menu in Action Builder to make your form do what you need it to do.
    And if all else fails, ask this forum. I struggle for just so long before I come here and ask for help. I always get the answer I need. I hope you will too.
    Good luck,
    Jeanette

  • Using javascript to show/hide buttons

    I need to show a hidden button on a slide, but I need to do it from within a javascript that is being called.  Does anyone know how to do this?  I know there are functions you can use to get/set variables (cpEIGetValue) but I don't know how to access &/or manipulate objects...
    Help?
    Thanks - Monica

    Hello,
    I'm sure this could work with advanced actions
    Since I have been blogging and writing a lot about advanced actions, perhaps I could help to debug? If this is acceptable to you, I will have a look at your actions, and try to understand what you want to realize. What do you think?
    Here is a link to my blog, just to prove my credibility:
    lilybiri's posterous
    Lilybiri

  • Radio Button  javascript onclick  show hide textbox

    Currently, if the radio button is clicked then text box is
    shown else if radio button 2 is clicked then textbox is invisible.
    (only one textbox being shown or being hidden)
    I wish to have 2 text boxes
    If radio button 1 is clicked then textbox1 is visible
    If radio button 2 is clicked then textbox2 is visible.
    What changes do I have to do in my code for this to work?
    feel free to test this.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <script type="text/javascript">
    function hide() {
    var div_ref = document.all("id_div");
    div_ref.style.visibility = "hidden";
    function show() {
    var div_ref = document.all("id_div");
    div_ref.style.visibility = "visible";
    </script>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    </head>
    <body>
    <tr>
    <td>
    Select Device Type <BR>
    </td>
    <td style="width:200">
    <input type="Radio" name="DeviceGroup"
    value="Radiobutton1" onclick="show();" checked="checked">Radio
    button 1
    <input type="Radio" name="DeviceGroup"
    value="Radiobutton2" onclick="hide();" unchecked>Radio button 1
    </td>
    <td>
    <div id=id_div style="visibility:hidden;">
    Show Textbox1
    <input type="Text" name="Textbox1">
    </div>
    </td>
    </tr>
    </body>
    </html>
    Thanks

    thanks
    YES
    i will be submitting data to a field in the database.
    First the vlaue of the radio Button
    For example if the first radio button
    then the value of the first radio button value =1
    goes to the field in the database
    also
    the text box that will show. will have data entered in the
    tesx box and the value will be submitted
    to a field.
    thanks
    shall i still use your code????
    thanks
    also, instead of having 2 javascripts controlling the show
    hide, just join them and assume that at each click the div is
    visible.
    the first part of the if statement in the js just makes sure
    the div's display is none. then it displays the one you are
    calling.
    the else allows you to close the divs without having any
    open.
    i'm doing this from home, so i cant really test it, but, it
    looks like it should work.
    Attach Code

  • Help Needed with JavaScript for show/hide subforms controlled by dropdown selection... Please!

    I have created a form that depending on what is seleced in a drop down menu it should determine what subform is displayed. The code I am pasting below only works with one (4 total) of the selections in the dropdown.
    I am not a scriptor by any strectch of the imagination! Can anyone see what I need to fix in the below to get this to work. It is almost like I am missing some sort of "or" statement... Any suggestions?
    Here is the current javascript associated with the dropdown field:
    form1.jobselection.customjob::change - (JavaScript, client)
    customprint.presence = "hidden";
    frontpagenote.presence = "hidden";
    weprint.presence = "hidden";
    preprint.presence = "hidden";
    if (xfa.event.newText == "CustomPrint"){customprint.presence = "visible";}
    else {frontpagenote.presence = "hidden";
    weprint.presence = "hidden";
    preprint.presence = "hidden";}
    if (xfa.event.newText == "PrePrint"){preprint.presence = "visible";}
    else {frontpagenote.presence = "hidden";
    weprint.presence = "hidden";
    customprint.presence = "hidden";}
    if (xfa.event.newText == "FrontPageNote"){frontpagenote.presence = "visible";}
    else {preprint.presence = "hidden";
    weprint.presence = "hidden";
    customprint.presence = "hidden";}
    if (xfa.event.newText == "WePrint"){weprint.presence = "visible";}
    else {frontpagenote.presence = "hidden";
    preprint.presence = "hidden";
    customprint.presence = "hidden";}
    form1.jobselection.customjob::click - (JavaScript, client)
    if (customjob.rawValue == CustomPrint)
    xfa.resolveNode(form1.jobselection.customprint).presence="visible";
    else
    xfa.resolveNode(form1.jobselection.customprint).presence="hidden";

    First of all i suggest you clean up the code a bit. Use this for example.
    var strSelectedText = xfa.event.newText;
    customprint.presence      = (strSelectedText == "CustomPrint") ? "visible" : "hidden";
    preprint.presence            = (strSelectedText == "PrePrint") ? "visible" : "hidden";
    frontpagenote.presence   = (strSelectedText == "FrontPageNote") ? "visible" : "hidden";
    weprint.presence            = (strSelectedText == "WePrint") ? "visible" : "hidden";
    //Optional code for checking values. You might want to put this in the exit-event.
    console.show();
    console.println("value = " + strSelectedText );
    console.println("customprint.presence = " +customprint.presence );
    console.println("preprint.presence = " + preprint.presence );
    console.println("frontpagenote.presence  = " + frontpagenote.presence  );
    console.println("weprint.presence = " + weprint.presence );
    // End optional code.
    What the above does is just have the same if/else you use, it just does it in much less code/scripting.
    The optional code is for you to verify what actually goes on. Wich values are changed or given, etc.
    What also might help is to write down the full path off the subform you want to change the presence of.
    So instead of "frontpage.presence" you write down "form1.frontpage.presence".
    Hope this helps.
    Rien.

  • Using Javascript to show/unshow a field based on input in another field

    I want to display/not display a field in a JSP depending on what is selected in another field.
    I am using <div></div> element currently which is displayed/not displayed using a Javascript invoked by the first field.
    the problem with div is that I have to put it inside a <tr><td> otherwise it doesn't work. This makes the field look aloof from the rest of the page, and is also not aligned with the other fields.
    Is there anything other than <div> that can be used? or is there a way to correct the look of the field inside a div?
    Thanks

    You shouldn't have to put it inside a <tr><td> to get it to work. I've done what you are trying to do with <span></span> and it worked fine. I haven't tried it with a <div> but I can't image why that wouldn't work. Maybe you could post your code.

  • Using javascript to show all comments on startup

    I would like all comments to show on all documents when a document is opened.  Right now I have the following code to create a menu option. This runs fine, but when I make a simple call to showAllComments(), I get the error "this.syncAnnotScan(); is not a function"  How can I get the function showAllComments() to run when Adobe Reader is opened?
    if ( typeof sdkMenuItem == "undefined")
              var sdkMenuItem = false;
    if (!sdkMenuItem) {
              sdkMenuItem = true;
              app.addSubMenu( {
                 cName:"ACROSDK:JSSubMenu",
                 cUser: "Acrobat SDK JavaScript",
                 cParent: "Edit",
                 nPos: 0
    app.addMenuItem({
       cName:"ACROSDK:ShowAllComments",
       cUser:"Show All Comments",
       cParent: "ACROSDK:JSSubMenu",
       cExec: "showAllComments();",
       cEnable: "event.rc = (event.target != null);" // active only with docs open
    * main function
    function showAllComments()
        try {
                            this.syncAnnotScan();
                        var annots = this.getAnnots();
                        if (annots == null) { app.alert('not found'); }
                        for (var i=0; i<annots.length; i++)
                                            annots[i].hidden = false;
       catch(e){app.alert(e);}

    You shouldn't have to put it inside a <tr><td> to get it to work. I've done what you are trying to do with <span></span> and it worked fine. I haven't tried it with a <div> but I can't image why that wouldn't work. Maybe you could post your code.

  • Can someone please help? Show/Hide layers

    Hi there,
    I am making a site for a friend and am having some weirdness
    that I can't figure out. I have a series of layers that show/hide
    based on various selections. Nothing complicated by any means. I am
    using the Dreamweaver Show-hide layers functionality. I am sure I
    have used it before in exactly the same way and not had this
    problem.
    So here is what it is. The page loads and most of the layers
    are set to hidden and then they get toggled on/off based on various
    selections. For some reason when the page loads in IE, all of the
    layers are visible. In Firefox they are hidden as intended.
    If someone has come across this before, or could take a
    moment to look at the site, I would be very grateful. I have stared
    at this and tweaked it so much that I am at a loss and I know that
    my friend is really needing her site to just be up and running.
    Also, now that I think of it, (and this is more of a nuisance
    than a problem) I am using the snap layers extension to position my
    layers. When you look at my site you will see that the layers look
    crazy when the page loads and then eventually move into place. Is
    there a way to make it so the layers are just already in place? Or
    even if they could not become visible until after they have
    snapped?
    Thanks in advance. I really do appreciate any help you could
    provide.
    The address for the test server is
    http://www.jcopple.com/rtc/index.html
    Josh

    I agree with the honest answer. This is a very poor way to
    make a page.
    Nevertheless, in DW's design view, use the A/P Element panel,
    and make sure
    that the eyeball icon is CLOSED for each layer that you want
    to be hidden
    when the page loads. Then save and upload the page.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "CaptFlynn" <[email protected]> wrote in
    message
    news:fvdd2f$7t3$[email protected]..
    > Hi there,
    > I appreciate your honest answer (though it wasn't what I
    wanted to hear,
    > LOL)
    > but for the sake of time I would like to find a solution
    to the existing
    > problem and then once I have her at least up and
    running, I can go back
    > and
    > code it correctly.
    > So if you have any suggestions as to why the layers
    wouldn't be hidden,
    > Iwould
    > really like to hear them.
    > Thanks,
    > Josh
    >

  • Using JavaScript to Hide/Show Items

    Hello
    Trying to use Javascript to check a List Item value.
    IF List Item value IS NULL THEN
    HIDE some other items
    ELSE
    SHOW some other Items
    I managed to locate some code to determine a NULL value.
    This works and I even can display a an alert message
    When I attempt to Hide the other Items, nothing happens
    Any Help on this matter - Urgently required for a Deadline
    Here is the code I am using :
    function show_InvestigatorData(){
    var lCheck = html_SelectValue('P1000_INVESTIGATOR_ID');
    // if Investigator populated, show the Investigator fields
    if(lCheck &&
    lCheck != '' &&
    lCheck != 'null' &&
    lCheck != '' &&
    lCheck != ' '){
    alert('this value is ' + lCheck);
    html_ShowItemRow ('P1000_INVESTIGATION_START_DATE');
    else {
    // otherwise hide the Investigator fields
    alert('this value is null');
    html_HideItemRow ('P1000_INVESTIGATION_START_DATE');
    Many Thanks in advance
    Ade

    Ade,
    Carl Backstrom has a great sample site with examples of what I believe you are trying to accomplish:
    http://apex.oracle.com/pls/otn/f?p=11933:5:661046971170606::NO:RP::
    From either the menu or the index, select Javascript and then "Show/Hide/Toggle Form Items".
    Hope you don't mind the plug Carl.
    MovingTarget

  • Using Javascript to hide objects that have no "binding" tab?

    Hello,
    I'm attempting to create a form that uses checkboxes to hide a variety of fields. I've run into a problem though; it seems that only text fields have a binding tab (unless I'm missing something).  Is there a way for me to do show hides for images and text boxes? When I hold ctrl and hover over these items there is a small circle with a red line through it, which seems to express that it is impossible to manipulate them using javascript.
    For the record, I'm using javascript as seen below:
    BusinessDBAname.presence = "hidden";
    If someone had any definite answers on this I'd really appreciate it.

    Hi,
    sorry to say that, but this is a really bad form design.
    There are a couple of things you can make it better.
    1. Give unnamed subforms a suitable naming
    2. Use subforms to organise your form
    3. Don't embed fonts at all when you only use the default fonts Arial or Myriad Pro
    4. Don't select the checkbox to embed images (they will get embedded always but this method requires more space)
    5. Set option to prevent script changes in the form to automatically, otherwise the changes wont be saved
    Ok, I suggest you to create a set of subforms to represent your Section 1 - 9.
    In each subform you then add a subform for business and sole proprietor.
    Into those subforms you then put the desired fields, images etc.
    This allows you much shorter scriptings because you only have to change the presence of the surrounding subforms to show/hide an entire set of objects.
    You form design finally should look something like this.
    form1
         Maserpage
         PayeeSetupRequest
              Section1
                   Business
                        Textfield1
                        Textfield5
                   SoleProprietor
                        Textfield1
                        Textfield3
              Section2
                   Business
                        Textfield1
                        Textfield5
                   SoleProprietor
                        Textfield1
                        Textfield3
              Section3
    Hope this helps.

  • Using javascript to hide ap divs

    I want to write a function to hide 8 ap divs on my page, because I need to do this from various places, and using the show/hide behaviour is proving very timeconsuming, as every time I replace my images via the FW generated HTML, I have to reinstate the show/hide behaviour 8 times for each image.  Much easier if I could just call a function.
    I have scoured the net, and come up with various samples along the line of:
    document.getElementsByName('apDivName').style.visibility = 'hidden';
    which I repeat for each apDivName in my list.
    The problem is, I don't know javascript, and have no idea if getElementsByName is the right getElements or if visibility is the right property,but have tried various permutations on this theme.  No syntax error, but the functions called after this function don't run, so something is wrong.

    It's ok, I sorted it.
    document.getElementById('apDivName').style.visibility = 'hidden';
    I'd tried that already, but missed a capital letter in my function name, so it didn't work.  Duhhhh.

  • How to Hide f:subview using javaScript

    Hi
    In our application i have to hide and show the subview using javascript is it possible i tried like this.. but its not working
    <f:subview id="viewid" >
    // view contents
    </f:subview>
    In java script
    document.getElementById("viewid").style.visibility="hidden";
    Any suggestion to me..
    Regards
    Hari

    The f:subview doesn't render anything to the response. You should know that if you have checked the rendered HTML source.
    Wrap its contents in a h:panelGroup and give it an ID. And don't forget to adapt the clientside Javascript language on the clientside HTML source, not on the serverside JSF source.

  • Hide datefield coldfusion control using JavaScript

    I have a straight forward datefield control.  Looks like the following:
    <cfinput type="dateField" name="dt_RtDate" width="60px"  id="dt_RtDate" title="Enter or select repeat date" value=""  >
    Now I have a javascript function that happens on a click event that I use to want to hide this control it looks similar to the following:
    //Hide Repeater control
        var dtRepeater =  document.getElementById('dt_RtDate'); 
        dtRepeater.style.visibility = "hidden";
    this works fine, but there is a problem I notice.  The textbox dissapears and this is fine, but the calendar image control IS STILL VISIBLE?!
    So my question is I am not sure how to reference this control or property to make the entire thing go away.  I would also then like to know the flipside of showing it too (which I am using by saying ...  dtRepeater.style.visibility = "";   )
    So what do I have to do to reference the coldfusion date control to make it dissapear completely?
    Thanks,

    You could always put it inside a span or div and do your show/hide on that element.

  • Hide an HTML button using javascript

    Hi,
    I need to hide an html buttton using javascript. I have an radio button with values "YES" and "NO". If is select NO then i need hide the button without refreshing the page. Can anyone suggest me how to hide an button using javascript.
    Thanks
    Prashanth

    Prashanth,
    The exact solution will vary based on a few factors. The basic idea is to place an event handler on the radio button item that calls a function to hide/show the button. You might also want to call that function when the page loads too.
    If you put an example page on apex.oracle.com and provide the workspace/username/password I'll take a look. You can create a new account for this purpose.
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

Maybe you are looking for

  • How to read  *.pdf files and store them in a database?

    Dear programmers, I have problem with reading *.pdf files and store them in a database. can any one help me, please! Is it possible to read more than one file from the local system and store them in a database. thnaks in advance. bye

  • Setting focus to a jsf component inside a tab.

    Hi, How can I set focus to a jsf component that is placed on some tab other then the first. Suppose that on the 2nd tabitem of the tab. there are some components on this tab . How can I set the focus to any one of these components on tabitem2 when th

  • I cannot download the latest QuickTime 7 plug-in for Firefox on Windows 7

    This all started when a website I go to frequently told me that my QuickTime plugin 7.3.1.70 in FireFox was "vulnerable". I told Firefox to update it and got to a dialog box asking me if I wanted to "Save file" to save the installer binary. I pushed

  • ADOBE READER , PDF READER FOR NOKIA C3....PLZ HELP

    DOES NOKIA C3 SUPPORTS PDF FILE ?? IS THERE ANY DOWNLOAD LINK SO THAT I CAN DOWNLOAD PDF READER FOR MY NOKIA C3???PLEASE HELP !!THANKS IN ADVANCE..... Solved! Go to Solution.

  • Bug between bootcamp and recent W7 update ?

    Hello, I have a Mac Pro with several hard drives, one being partionned: - Snow Leopard 10.6.8 kernel 64 bits - Window 7 64 bits, bootcamp 3.3 This configuration has been running perfectly since more than 24 monthes, even with all the W7 updates. Toda