Buttons & Javascript

Greetings,
I have a PopUp (called by the popUp2() function) that I want to save and close immediately after saving by clicking an Enter Comment button. I have that working (with some help on the forum, thanks).
The initial Enter Comment button is a region button with this in the URL Target:
javascript:doSubmit('CREATE');window.close();
This works perfectly.
I want to move the button below an item, so I created a javascript button that executes a javascript function when clicked. The code for that button is:
<input type="button" onclick="button_Action()" value="Enter Comment" />
As you can see it calls the button_Action() function. This is the code for that function (which is in the HTML Header):
<script>
function button_Action(){  
doSubmit('CREATE');
window.close();
</script>
When I click the javascript button the window closes, but the page is not submitted (the comment isn't created). If I remove the window.close() the page is submitted and the comment entered, but the window doesn't close! Arrgh! :-)
I'm stumped. Why does the javascript work differently when it is in a function as compared to being in the URL Target?
Also, what do I need to do differently to get it to work the way I want?
Thanks, Tony

Hi Andy,
Thanks for the info.
Below is what I have in my PL/SQL, how does it look?
BEGIN
-- Closes this popup window.
htp.p('<body>');
htp.p('<script type="text/javascript">');
htp.p('window.close();');
htp.p('</script>');
htp.p('</body>');
END;
There must be something wrong, because it doesn't close the window.
I simply have it running after the DML process, it isn't even conditioned. It excutes after the page is submitted.
Thanks, Tony

Similar Messages

  • I click a box on a website and nothing happens. When I hover over the button "javascript:void(0); appears on the left"

    I click a box on a website and nothing happens. When I hover over the button "javascript:void(0); appears on the left"

    same issue

  • How to lock a form (all fields read only) using a button (JavaScript)

    Hi guys,
    I have a form with several input fields, check boxes. Using a button in the form, I would like to lock it using a JavaScript. Locking means in my case that all input fields, checkboxes, etc. are read only (cannot be changed anymore).
    I already use the following approach:
    data.form.MyInputField.access = "readOnly";
    The problem is, that this approach is not comforable from maintenance perspective. I would like a more generic or more simple way.
    Generic:
    loop over all fields and set them to "read only"
    Simple:
    xfa.form.lock; // but this does not work
    Do you have any ideas how to solve this requirement in another way as I currently do?
    Thanks,
    Thomas

    Now I used the following script:
    // set the whole form as container
    var objContainer = data.Report;
    // call the method to set all fields to read only (recursion)
    disableAllFields(objContainer);
    function disableAllFields(objContainer) {
         for (var i=0; i < objContainer.nodes.length; i++) {          
              switch (objContainer.nodes.item(i).className) {
                   case "field" :
                   case "exclGroup" :
                        objContainer.nodes.item(i).access = "readOnly";
                        break;
                   case "subform" :
                        disableAllFields(objContainer.nodes.item(i));
                        break;
                   default:
    It works but is there another possibilitiy such like
    form.lock;
    Thanks,
    Thomas

  • Need some help with button JavaScript for Save As event.

    Hi,
    I'm using Adobe Acrobat X Pro and am completely new to scripting forms in Adobe (completely new to Adobe Acrobat as well!).  On a form there is a save button that opens the Save As dialog by using a trigger (Mouse Up) and action (Execute a menu item - File>Save As...>PDF...) and this works fine, however, I want to now use javascript to modify this button's behavior so that is uses a trigger (Mouse Up) and action (Run a JavaScript), and I want that JavaScript to combine the text values from two form fields (a location Dropdown and a date Text field) and use this concateneated string + ".pdf" as the filename when it opens the Save As dialog.  Make sense?
    This is what I have added to the button as a JavaScript so far I am using a test string at the moment ("NewFile.pdf") and will add the concatenated string to the script after I know the script is working as it should.
    var newFileName = "NewFile.pdf";
    var pathArray = this.path.split("/");
    pathArray.pop();
    pathArray.push(newFileName);
    this.saveAs(pathArray.join("/"));
    Two issues so far:
    1. When I click the button nothing happens, no Save As dialog or anything. 
    2.When I check the button properties under the Actions tab the Select Action property shows "Execute a menu item" even though I previously selected "Execute a JavaScript"
    Thanks for any help!

    Thanks guys, I appreciate the response!  If I can bypass the Save As dialog and save the file to a default location using a file name that is contructed from two form field values then that would be perfect. I definitely think it is feasible to have a script file installed locally on each users workstation. I don't quite understand about folder-level security, etc. yet but am eager to learn how to do this stuff if you can give me gentle push in the right direction!  Thanks!

  • EMail Submit Button - Javascript warning

    On Friday, my distributed pdf worked perfectly. On Monday, when selecting the "Submit by eMail" button, it generates a javascript warning which then requires the user to fill out all of the senders email information and go through several warning screens. Previously, this only happened if there was no regular email client set up on that machine.
    What happened, and how can I find a solution? There were no modifications done to the file. I have tried to remake the form several times, and the javascript warning comes up each and every time on multiple machines.

    For some reason, I could not see that there was a response noted anywhere on the system, until I opened the original message. Is there an issue with the board? I just sent you the three files involved, via email.
    Thanks for your assistance.

  • Safari Pop up buttons / javascript

    I want to be able to select a specific item in a list of a pop up button in safari, i can do it by using a repeat statement and get value of button, with key codes simulating down arrow. This is tediously slow to the say the least. When i go view source of the page there is an identifier for the option i want, option value="f724". Is there a way to set the value of the pop up button to this number, i cant seem to do it. I was reading around the forum and found some mentions of the term do javascript but i have no idea how to implement it in this case, or if it at least possible.

    My search_replace(x, y, z) subroutine was a very basic attempt at encoding the URL properly. As it happens omitting the handler entirely and just setting keyword to text returned of result works the same in this case. The spaces get replaced with %20 by default, and the Discussions search app doesn't seem to mind.
    This style of search & replace is known as a "text item delimiters" or TIDs for short. You may have heard of a tab-delimited file. These contain cells of information separated by tabs. In the case of AppleScript's text item delimiter, we can set it to tab or any other character, and then ask for a string's "text items" provided in list form. So the steps taken by the handler in pseudo code are:
    1. Pass the text returned of the display dialog command to the search_replace handler, along with the search string "space" and the replace string "+"
    result: {"yellow fever", space, "+"}
    2. save whatever the current value of text item delimiters is
    This is to avoid potential conflicts with other code that may be using the delimiters property.
    result: {"[… anything]", ""}
    3. change the value of text item delimiters to space
    By defining " " (space) as a delimiter, we are effectively stripping every occurrence of the space character out of our string. This is because it can now be seen as a special delimiter character, as opposed to a literal one.
    4. get the text items of our string as a list
    result: {"yellow", "fever"}
    5. change the value of text item delimiters to the + symbol
    While our text string is a list, we are going to be sneaky and change the delimiter property from space to plus sign, like the one found in our original URL at Apple Discussions.
    6. coerce the list of text items back to a string
    When AppleScript coerces a list into a string, it automatically inserts the delimiter character you have defined in between each item.
    result: "yellow+fever"
    7. set the delimiter back to the way we found it in step 2
    The way I've written all this in actual code is highly abbreviated. To help read it easier remember that I'm addressing a reference to the delimiters, so every time you see the word "contents," that is referring to the text item delimiters. Also note that
    set {a, b} to {"a", "b"}
    is the same thing as
    set a to "a"
    set b to "b"
    The only difference is that the former is written in one line, and the latter is written on two lines.

  • Flash button  & javascript help

    I had a site up for quite a while and then one day it stopped
    working - had designed it a specific size - so had an
    intro page. On that page is
    the function
    function NewWindow(url, windowName, w, h, scroll) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops =
    'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
    win = window.open(url, windowName, winprops);
    if (parseInt(navigator.appVersion) >= 4) {
    win.window.focus();
    In the SWF file the button that says enter has the following
    code:
    on (release){
    getURL("javascript:NewWindow("eyeconography.html","eyeconography","800","550","no")");
    Everything worked for years - and then one day did not in any
    browser (I think). This was not the only button effected.
    Thanks in advance for any help.

    Thanks for checking it out - I have a PC at work and the
    pop-up menu works on that computer, But It stopped on Macs - so now
    I think it is some security issue. I dont' know anything about the
    param name allowScripts, but maybe it has to do with that. I was
    wondering if anyone knows something that could have changed that
    would have suddenly changed the functionality of that button on
    Macs.

  • 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

  • Button javascript dosubmit

    hello,
    i have a button that submits the page.
    I want to show an alert box, if certain conditions are met ( for example, text box is empty ) and do NOT submit the page - redirect to this same page. If those conditions fail, then continue with doSubmit flow.
    // I do know that this can be done using the validation tab, but i'm just curios how to implement this in javascript.
    thank you.
    Andrew

    Andrew,
    With Apex 4 this is supposed to become much easier. If you'd like to do it now it's a bit more work. You basically change the button to call a custom JavaScript process which will in turn call doSubmit if/when you want it to.
    You do this by setting the button's Optional Redirect to URL and then putting something like the following in:
    javascript:validateMyItems();Of course there'd have to be a function of that name to do the job. Warning - JavaScript validation should not replace server side validation - it should supplement it.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Button, Javascript Confirm Box and Process

    I have a button on a page. When someone click on the button, depends on the value on a item, if it's not null, then pop up a confirmation box, if the item is null, the call a process directly. If the confimation is true, then call the same process, otherwise page won't be to submitted.
    I' m still on version 1.6.
    Anyone could give me some help?
    million thanks!
    Ran

    Thans for the reply.
    Here is what I did:
    I created another item called itemB. And put a javascript function on the HTML Header. And put a image button and use onclick to trigger the function. Based on the confirm is true or false, the javascript will set the itemB to two different values. And the process will run based on the value of the itemB. It seems to work sometimes, but not always. I don't know if I am missing anything or maybe it's not a right way to do it. Could someone take a look for me. Here is the javascipt.
    <script language="JavaScript" type="text/javascript">
    function checkMissing(formItem,formItem2)
    var t1 = document.getElementById(formItem).value;
    if (t1 != null)
      conmod = confirm("There is/missing parts, Do you wnat to continue to close the seesion?");
      if (conmod == true)
       document.getElementById(formItem2).value = "CLOSE";
       doSubmit();
      else if (conmod == false)
        document.getElementById(formItem2).value = 0;
      else
       document.getElementById(formItem2).value = "CLOSE";
       doSubmit();
    </script>

  • Help! history.go(-1) Back Button JavaScript in Safari

    Hello,
    I wanted to create a quick back button using the simple history.go(-1) JavaScript. It works in all browsers except Safari. Any workarounds? Thanks much!
    -Scott Lunceford

    Hello, Ryan.
    Sorry for the delayed response. Thanks for your reply -- it led to a solution.
    Basically, the button code worked for me:
    input type=button value="Back" onClick="history.go(-1)"
    But the link code didn't work:
    a href="#" onClick="history.go(-1)">Back
    I wanted my own custom button, so after trying both lines you provided and seeing that the form <input type=button ... > worked, I modified it slightly to this:
    input type="image" src="back.gif" onClick="history.go(-1)"
    Which worked like a charm. Still not sure why I couldn't get the link code to work....
    Thanks again.
    -Scott

  • Change page1 presense to Invisbile when click button - Javascript of Calcform script please

    I have a form with a button on it. I want page 1 of the form to be invisible once the button is clicked.
    Page is named Page1
    Button is named Finish.
    Thank you.
    John

    Make sure that you form is set to be Dynamic. Make sure the button is not on page 1. Assuming that your root level node in your hierarchy view is form1. On the click event of the button set this javascript code:
    form1.Page1.presence = "invisible";

  • Gif image button/javascript not work in mac firefox

    I have a GIF with an image map over it that launches a new
    page with Javascript. It appears and workd fine in all browsers pc
    and mac apart from firefox on a Mac where it does not appear.
    Any ideas?
    Thanks

    Vasilius,
    The following is a general list of things you may try when the issue is not in a specific file (you may have tried/done some of them already); 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to 3 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible);
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall, run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • How to create PDF Merging Template with Buttons & javascript?

    I am trying to create a PDF template that has buttons that request a file or email be inserted as you progress through the document.
    There will be a drop down menu that has options for different types of "customers", each type of customer will show a different set of buttons.
    Each button, once clicked will prompt for a PDF document to be inserted. Each button will be labeled what it requests. For example, "Receipt", "Title", "Insurance Policy" etc. The documents will need to be merged in the order they were received via the buttons.
    In the end, after all the buttons have requested the specific file, it will merge the selected files into one PDF document.
    Does anyone have some insight or ideas on how to get started on this? I am sure Java script will be involved.
    Thank you! Your help is appreciated!

    Hi Travis ,
    You are absolutely correct ,to get more accuracy ,you will certainly have to use java script to get this task done.
    However if you want to add buttons ,you can do it from Acrobat.
    Tools>Interactive Objects>Add Button
    Please check the button properties if it reduces your work to any extent .Go through all the options and see how it goes.
    Regards
    Sukrit Dhingra

  • Can't Login to Steam, the button (javascript:dologin) wont respond

    i can't log in to steam from firefox, while i can login just fine using steam client internal browser.
    after i fill out my username and password on steam login page, the login button doesn't respond at all, i tried pressing enter and still no go, i think i can still login when i was on firefox 16.
    and i have tried clean uninstall firefox 17 and then reinstalling it again, and it still wont work at all.
    i've tried disabling my addon, cos i thought maybe some of the addons is causing issue, but still nothing.
    addons that i used are adblock plus, better privacy and password manager.
    please fix this, cause steam client internal browser are too slow.

    Hello,
    I had the same problem two minutes ago, but I have found a solution. Simply use the Community login page and then switch to store.
    http://steamcommunity.com/
    Hope that helps you and those who found this thread with google like I did,
    Ragnarous

Maybe you are looking for

  • Fonts from an SVG not selectable in a PDF

    Hello, We are importing SVG images into FrameMaker 7.1 and then creating a PDF (process is - In FrameMaker, print to file and then distill using Distiller 6). When we open the PDF, some images are dropping various characters. For example, the letter

  • Red Light on Drive

    Just want to make sure before replacing, but a red light on a drive indicates failure, correct? The event log doesn't indicate anything. If I replace with an identical 180 gig drive, but one that was purchased used, is there anything that needs to be

  • Wildcards in the class definition

    I have a class which extends java.util.Hashtable. The Key is String and value is a HttpClient object, but in future I can have Values as objects other than HttpClient. I was thinking to use a wildcard for storing the value, but the syntax isn't right

  • Company email through exchange

    I have tried every way possible to get my storm 2 to activate with my company email and will not connect?  Why?  I talked with my IT department and they have supplied us with all the information.  It wants an exchange URL, and I have provided that UR

  • My home page is being shown in detail format

    when in ie9 the home page shows properly, however when going to FF 3.0 18 it shows as in the detail format--no pictures etc. on my desktop FF works properly on my laptop