Button name variable?

Hi,
I am trying to create a small piece of javascript code that is called when I press a button on a page. At the end of the javascript the regular doSubmit is called.
The javascript looks something like this
  function mySubmit(pRequest){
    /* my javascript here */
    doSubmit(pRequest);
  }The button calls the function like this:
  javascript:mySubmit('APPLY');However, I'd like to make it as generic as possible. Now I have to insert the correct name of the button into the call, so that it is passed on to doSubmit.
Is it possible to substitute the actual button name with a variable:
  javascript:mySubmit('#BUTTON_NAME#');Or is there another trick that does not require the button name(=request) to be specified explicitly?
Thanks!
Rob

Hi ATD,
Thanks very much for your reply.
I'm having some problems with the javascript though :(
The function is called with this as a parameter :
<a href="javascript:html_Submit_Progress(this);">
  <img src="/i/ph_btn_apply.gif" alt="Apply" border="0"  />
</a>This is the function
function html_Submit_Progress(pNode){
  var i = pNode.getElementsByTagName('IMG');
}And the function gives an error on the very first line.
Firefox says: pNode.getElementsByTagName is not a function
IE: Object doesn't support this property or method.
I know this is not a javascript forum... but if there's anyone who can help me with this, I'd be very thankful.

Similar Messages

  • Set variable equial to button name that was clicked

    I know how to do this in Flash, but don't see a way to do it in captivate? When one of 26 buttons are clicked, I need to set a varaiable with the button name. Then jump to a page that has 26 grahics hiden. On enter I need to unhide the one named the same as the button.

    I'm glad I saw this post at the top of the list.  I wanted to do this too.  I have 15 click boxes that are used as bonus points.  When clicked I would like to do the following:  (1) Hide the click box and icon group that was clicked.  (2) Increase my "score" variable.
    It would be nice if it used the "this" function, like is done in Jquery / javascript, along with wildcards in the variable name.  This way, I could create 1 Advanced Action script that could work for any of the click boxes.
    Oh well...I'm off to creating 15 scripts.  Maybe I'll watch a movie while I do it. 
    Micky

  • Change button name in a for-loop

    Hi all,
    I would like to implement a 'for loop' to add buttons to my panel depending on the value of max_number.
    The postion of these buttons will also change with each passing of the loop.
    The code below implements this. But when I click the buttons they only return the action listener of the last button drawn. This is because the JButton my_button is reused in each pass through the loop.
    What I need is to change the name of the button on each passing of the loop so that I create a new button each time with it's own unique action listener.
    Is there a way of adding/appending the value of 'i' to the button name each time the for loop is run?
    For example
    When i = 0 -> JButton my_button0 = ...
    When i = 1 -> JButton my_button1 = ...
    etc, etc,
    for (i = 0; i < max_number; i++)
    JButton my_button = new JButton(Integer.toString(i));
    my_button.addActionListener( new ActionListener()
    { public void actionPerformed(ActionEvent event)
    { do something depending on the value of 'i' }});
    addComponent(my_button, (2*i+1) , 4 , 1 , 1); //add newly created button to position x = (2*i+1), y = 4
    } //end for

    What?! Are you talking about the variable name? You can't, shouldn't, needn't use different variable names in a for loop, since the variables "expire" each time the loop is run. For instance:
    for(int i = 0; i < 10; i++) {
       //j doesn't exists even if this loop is on its 10'th lap!
       int j = i;
    }And you will have a problem with the ActionListener as well, since it depends on the "i" variable. "i" can't be accessed from an anonymous class unless it has been declared final, in which case it won't work for you.
    So: the my_button variable will contain a new JButton each time!
    Nille

  • Save Status of Radio Buttons and Variables

    I designed a form that uses a Raddio Button with three choices. These choices selectibles enable/disable areas of the form. The user will save the form with a different name for archival. Right now if I save the form, the status of the Radio Button and variables used in the JS code are not stored. So if I open the saved file, the form will not reflect the original status of Radio Button and variables.
    What's the best way to implement this?
    Can I save the status of the Radio Button (choice selected) and variables when the user saves the form and then restore them when opened back?
    Thank you.

    Without knowing more about what you're doing, it's hard to give specific information. I'm not sure what you mean about the status of the radio buttons since when a form is saved, their state won't change when it's reopened. For saving data, you certainly could use a hidden field and read it in using a script that executes when the form is opened.

  • Change Button Name in JOptionPane.showMessageDialog

    Hello,
    I've written the following code that invokes a JOPtionPane messageDialog, when the delete button is hit in the following frame and the selectedItem in the JComboBox is Default.
    I want to change the JOPtionPane button name from OK to Close. Is there a way to do this with error message dialoges, as their is with confirmDialoges?
    Please help out.
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    public class MyJOptionPaneTest {
         public MyJOptionPaneTest()
              JFrame frame = new JFrame("My Frame");
              JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT,5,0));
              final JComboBox myComboBox = new JComboBox();
              myComboBox.setPreferredSize(new Dimension(100,20));
              myComboBox.getModel().setSelectedItem("Default");
              myComboBox.addItem("Default");
              myComboBox.addItem("Other");
              JButton deleteButton = new JButton("Delete");
              deleteButton.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        if(myComboBox.getSelectedItem().equals("Default"))
                             JOptionPane.showMessageDialog(null, "Default cannot be deleted", "Error", JOptionPane.ERROR_MESSAGE);
              panel.add(myComboBox);
              panel.add(deleteButton);
              frame.getContentPane().add(panel);
              frame.setSize(200,100);
              frame.setResizable(false);
              frame.setVisible(true);
         public static void main(String [] args)
              MyJOptionPaneTest test = new MyJOptionPaneTest();
    }

    Hi,
    yes, I've looked at the tutorials. But there is no way to change button title for JOptionPane.showMessageDialog. Only JOptionPane.showOptionsDialog provides you w/ that feature, becuz it provides the parameter in the method.
    I was wondering if there was another way to do this for showMessageDialog.

  • Exporting each articles button names to an Excel Spread Sheet or other form

    Is there a way to export a list of all the button names in each article to an Excel spread sheet or some other form? If someone knows of a script that does this that would work to. The button names are based on their function: OL = Overlay, TAB = Tab and BTN = Button. Here is an example of one of the articles that we have gone through and named the buttons and what they do. We just do not want to have to go to each button in each article and copy and past it to an Excel doc.

    @stephen0218 – with the following line or the ones that you are using:
    app.documents[0].buttons.everyItem()
    you will hardly address all buttons in a document.
    At least not in a document that is prepared for ADPS.
    You'll get just the ones that sit plain on the page: not inside groups, not inside other objects like rectangles or states of MultiStateObjects (MSOs).
    You will have more luck if you are using "allPageItems" and sorting out the buttons.
    But be aware that "allPageItems" is blind to objects (also buttons) in states of MSOs that do not belong to the active state.
    Uwe

  • How to get the button name which triggred the post back

    i have multiple buttons on the apex page most of those have the event type as "post back". is there any way to get the button name through pl/sql which raised the post back event ?

    Tried v('REQUEST') or :REQUEST?

  • Change button names

    Hi Experts,
    Is it possible to change the button name in SAP documents? Ex. SO button 'ADD' changed to 'SAVE'.
    Thanks.
    Don

    Hi Don,
    Unfortunately, it is not possible to change button names, we can only change label names. If you want to change button names, you need to customize an addon.
    Hope it helps.
    Chinho

  • Run time update on Button name and Action of Button

    I want to change the button name and button path in the GUI directly. So user can update GUI as per their requirement.
    Now I have built a GUI with multiple buttons. Whenever the button clicked corresponding webpage will be opened. This Button name and webpage link can not be changed as per current GUI design.
    But I want to allow anybody to update the Button name and webpage link as per their need.
    Please suggest , how can I achieve it? Please share if you have some code snippet.

    Changing the text on a Swing JButton is pretty simple. That isn't an appropriate question for this forum, however. This forum is for questions concerning using or extending WindowBuilder. General Swing questions should be posted to a general Swing/Java forum.

  • Changing Prompt Button Name "Go" to "Apply"

    Hi,
    I want to change the prompt button name from "Go" to "Apply".
    How to achieve this?
    Thanks,
    Satheesh

    Hi, you can refer to http://bischool.wordpress.com/2009/07/18/change-go-button-name-of-obiee-dashboard-prompt/
    or
    http://www.obinotes.com/2010/09/change-go-button-text-in-prompt-only.html
    I hope this helps.
    J.-

  • Table name variable failes in OLE DB connection

    I'm getting odd behavior from an OLE DB Destination. I need to make the destination dynamic so I chose "Table name or view name variable" as the data access mode. When I put in what I know is a valid table name as the default value of the variable
    and click view existing data, I get the following,
    File not found (it's a DB2 db that calls tables files).
    The curious thing is when I choose SQL command and put in a query using the EXACT same table and click view existing data, it works. What am I missing here?

    Hi falcon00,
    I am unable to reproduce the error message, however, you can follow the steps below to create the variable properly:
    Remove the existing related variable(s). 
    Add a new Package scope variable named PRMSDestinationTable, set its data type to String, its value to TableName (without database schema).
    Press F4 to highlight the variable properties pane, set its EvaluateAsExpression property to True, and set its expression to @[User:: PRMSDestinationTable]. Evaluate the expression to make sure the result is correct.
    Regards,
    Mike Yin
    TechNet Community Support

  • Table name ? with query name , variable name and variant .

    Hi All,
    Is there any single table with fields as query name , variable name and variant ?
    or any table which i can build a view to get these fields.
    or any other way ?? to get this fields in single table
    Thanks,
    Ak

    Hi,
    first use the proper heading for a question.
    you want the query all details means technical name, variable and variable type use RSRTQ
    it will give total information of query.
    Bex related tables
    RSZELTDIR ----
    Directory of the reporting component elements
    RSZELTTXT ----
    Texts of reporting component elements
    RSZELTXREF  ---
    Directory of query element references .
    Thanks,
    Phani.

  • How to extract button name after message popup step completed?

    Hello!
    I wonder is it possible to get the pressed button name from "message popup"? It is easy to get button index, but I don't find a way to get buttons array. Is it possible to get buttonNlabel substituting N from button hit?
    Thank you in advance!

    Sure, just build an expression to do it. For example from the following step you could use:
    Evaluate(Evaluate("RunState.PreviousStep.Button" + str(RunState.PreviousStep.Result.ButtonHit) + "Label"))
    The inner Evaluate returns the expression for the button label, which is usually a string constant. The outer Evaluate evaluates that expression, which in the case of a string constant just removes the quotes.

  • Confused about a task sequence - multiple applications - base name variables

    Hello, 
    I am trying to get familiar in a new SCCM 2007 environment (badly documented I'm afraid). The TS used for computer deployment contains a long sequence of 'Install Software'-steps labled 'Install PACKAGES' (0 to 9). Within each of these the 'Install multiple
    applications'-box is checked and a Base Name Variable has been given (PACKAGES0 -->9).
    I have been reading about the mechanism behind defining variables in the CustomSettings.ini, but of all the CS.ini files I have found on the SCCM server I have not found traces of these variables.
    I have found no collections with these variables.
    So my question is: How to figure out what may be included in these ? What software is installed, if any? 

     When you deploy the task sequence to a computer, does it get any applications installed from these steps?
    The variables can come from different sources, like:
     1) Collections variables
     2) Computer variables
     3) Dynamically set variables, using either a custom script or MDT (CustomSettings.ini)
    If the computers get any of the "unknown" packages installed, try looking in the smsts.log on the client.
    This should also give you an indication, where the variables come from.
    You can get all computer variables with this small PowerShell script - This can help you identify if the variables are set per computer:
    $smsprovider = "Server01"
    $sitecode = "CEN"
    $objMachineSettings = gwmi -ComputerName “$smsProvider” -Namespace “root\sms\site_$siteCode” -class “sms_machinesettings”
    $objMachineSettings.Get()
    ForEach ($objComputerVar in $objMachineSettings.MachineVariables)
     Write-Host "ResourceID:" $objMachineSettings.ResourceID  "Variable:" $objComputerVar.Name "=" $objComputerVar.Value
    -Heine

  • Button Name

    Button newbutton = new Button(string); Java automatically assignes a name to each of these buttons that are created in my app. (button0 - button16) There is a way to get their names but I forget. I tried getName() but that just returns the name of the frame that they are in. What is the correct statement to use?
    full code:
    class ButtonPanel extends TopPanel
              public ButtonPanel(String A)
                   int strA = Integer.parseInt(A);
                   int globalclasssize = strA;
                   int gridSize = (int)( Math.ceil( Math.sqrt(globalclasssize) ));  //this line takes the sqrt of the number
                   this.setLayout(new GridLayout(gridSize,gridSize));            // entered and rounds up to make a suitable grid.
                   int idnum = 1;
                   for(int num = 0; num<globalclasssize;num++)
                        int id = idnum++;
                        this.add( getButton("Desk " + id) );
                        this.add( getSpacer("") );
                   this.setVisible(true);
              public Button getButton(String string)
                   Button newbutton = new Button(string);
                   newbutton.addActionListener(new java.awt.event.ActionListener()
                                       public void actionPerformed(java.awt.event.ActionEvent bevt)
                                                 enterbActionPerformed();
                   seatname = getName();
                   System.out.println(seatname);
                   return newbutton;
              public Button getSpacer(String string)
                   Button newbutton2 = new Button(string);
                   newbutton2.setVisible(false);
                     return newbutton2;
    /* Action Events for Button */
    public void enterbActionPerformed()
        seatname = getWHATGOESHERE();
        System.out.println(seatname);
    }

    The information you need to identify the button that generated the action event is in the event object bevt. If you're going to use another method for the actionPerformed() method body you must send along the event object:
    public void actionPerformed(ActionEvent e) {
      enterbActionPerformed(e);Here's a way to get the button id in actionPerformed:
    public void actionPerformed(ActionEvent e) {
      Button button = (Button)e.getSource();
      String ac = button.getActionCommand();
      // if you had declared the button names, eg, Button Desk1, Desk2,...;
      // then you could use
      if(button == Desk1) {
        // what to do when Desk1 is pressed
      // another way is to use the action command
      // there is a caveat with this approach: if your code gets translated
      // into another language the text on the buttons will change which
      // will change the action commands, unless you set them explicitly
      // (this is a bit tricky the way you wrote your code)
      if(ac.equals("Desk1")) {
        // carry on
      // to set the action command
      newbutton.setActionCommand(string);
      // in getButton()

Maybe you are looking for

  • Re-generate and/or re-activate

    If I add a new field to the end of a custom data base table (Z table) and there are programs that already use the Z table but will not care about the new field added to the end of the Data Base definition, do I have to re-generate and/or re-activate

  • Switching To Mac From Windows?

    First post here, so I'd firstly like to say Hello to everyone and wish them a happy new year Basically, I'm curious to know if any of you have switched to a MAC from a Windows based machine, and if you found the transition easy and "complete" in the

  • Crystal Reports Server XI - what files need to be backed up?

    I don't want to set up a fail over cluster which there seems to be plenty of information on. All I want to do is identify what files I need to backup incase I need to do a restore. We use Tivoli Storage Manageru2019s backup and recovery solution for

  • Any Oracle API to Finally Close, Freeze, Unfreeze and Hold POs or Releases.

    I know there is PO_ACTIONS.CLOSE_PO API which allow us to close the PO. We need to Finally Close, Freeze, Unfreeze and HOLD Pos/Releases. Does anyone know the Oracle API which can do this jobs. Thanks in Advance.

  • How do you get your adobe muse website on Google?

    I have a pretty simple website, and im using google webmaster and they gave me this code to verify that this is my website, and they tell me to upload it to my website?  how do I do that?