Javascript Submit button onclick event handler

Hi,
I am having trouble getting the onclick event handler of a form to execute when the button is pressed. I am trying to open a page in a new window depending on if the user selects that option in a checkbox.
There is one form(id='graphform') and 2 submit buttons, each with a checkbox before it. I want the new window to open only iuf the right checkbox and matching submit button has been checked.
One of the checkbox/button pair: The onclick="checkWindow('w1','graphform');" is never getting called.
<input type="checkbox" id="w1" name="win1" style="margin-right: 10px" value="window"  onclick="javascript:document.gform.win1[0].checked = true;"><a style="margin-right: 10px">Graph in new window</a>
<input type="submit" value="Create graph" onmouseover="this.form.cumulat.value='0';this.form.graphGroup.value='Consumption'; document.getElementById('hintSubmitStop').value='1';" onclick="checkWindow('w1','graphform');" onmouseout="document.getElementById('hintSubmitStop').value='0';" /></td></tr>Javascript window opener:
function checkWindow(win1, str){
          var formObj = document.getElementById(str);
     var checkBoxObj = document.getElementById(win1);
     if(checkBoxObj1.checked == true){
               formObj.target = "_blank";     
               formObj.action = "graphDisplayFrame.jsp";     
     else if(checkBoxObj1.checked == false){
               formObj.target = "_self";
               formObj.action = "graphDisplay.jsp";
}Any suggestions?
J

You're storing the value in "checkBoxObj" and in the next line you use different variable name as "checkBoxObj1".
     var checkBoxObj = document.getElementById(win1);
     if(checkBoxObj1.checked == true){
instead of "true', try      if(checkBoxObj.checked == 1){

Similar Messages

  • How to run a dialog's method from a button's event handler?

    I've created my first dialog from the samples, but I am having trouble figuring out how to run a method in my dialog from an button's event handler. Can anyone please point me in the right direction?
    function CreateDialog() 
        this.windowRef = null;
    CreateDialog.prototype.run = function()
        //...declare a bunch of vars
        // Create a window of type palette.
        var win = new Window("dialog", "Element Spray Generator",[iTop,iLeft,iTop + iWidth,iLeft + iHeight] );  // bounds = [left, top, right, bottom] 
        this.windowRef = win;
        // Add a frame for the contents.   
        win.btnPanel = win.add("panel", [iPadding,iPadding,iWidth-iPadding,iHeight-iPadding], "");
        .... add a bunch of other stuff ...
        win.btnAdd = win.btnPanel.add("button", [win.btnRemove.bounds.left - iPadding - iButtonWidth,win.lstImages.bounds.bottom + iSmPadding,win.btnRemove.bounds.left - iPadding,win.lstImages.bounds.bottom + iSmPadding +iTextHeight], "Add");
        win.btnAdd.onClick = function() {
           //todo implement this
           var f = File.openDialog("Open File") ;
           win.lstImages.add("item", f.displayName );
           this.EnableControls();    //<--- problem is on this line here!!
        this.EnableControls();  //<--- this works
        // Display the window
        win.show();
        return true;      
    CreateDialog.prototype.EnableControls = function (){
        var result = true;
        result = result && (this.windowRef.ddlPaths.selection != "");
        result = result && (this.windowRef.lstImages.items.length > 0);
        this.windowRef.btnOK.enabled = result;

    This may not be the reason, but when using the way I create dialogs 'this' inside of an onClick points to the control.
        win.btnAdd.onClick = function() {
           //todo implement this
           var f = File.openDialog("Open File") ;
           win.lstImages.add("item", f.displayName );
           this.EnableControls();    //<--- I would expect it to call another function of btnAdd
                                            // this.parent.EnableControls() might be what you want if the control is not in some other container

  • How can I execute an external program from within a button's event handler?

    I am using Tomcat ApacheTomcat 6.0.16 with Netbeans 6.1 (with the latest JDK/J2EE)
    I need to execute external programs from an event handler for a button on a JSF page (the program is compiled, and extremely fast compared both to plain java and especially stored procedures written in SQL).
    I tried what I'd do in a standalone program (as shown in the appended code), but it didn't work. Instead I received text saying the program couldn't be found. This error message comes even if I try the Windows command "dir". I thought with 'dir' I'd at least get the contents of the current working directory. :-(
    I can probably get by with cgi on Apache's httpd server (or, I understand tomcat supports cgi, but I have yet to get that to work either), but whatever I do I need to be able to do it from within the button's event handler. And if I resort to cgi, I must be able to maintain session jumping from one server to the other and back.
    So, then, how can I do this?
    Thanks
    Ted
    NB: The programs that I need to run do NOT take input from the user. Rather, my code in the web application processes user selections from selection controls, and a couple field controls, sanitizes the inoputs and places clean, safe data in a MySQL database, and then the external program I need to run gets safe data from the database, does some heavy duty number crunching, and puts the output data into the database. They are well insulated from mischeif.
    NB: In the following array_function_test.pl was placed in the same folder as the web application's jsp pages, (and I'd tried WEB-INF - with the same result), and I DID see the file in the application's war file.
            try {
                java.lang.ProcessBuilder pn = new java.lang.ProcessBuilder("array_function_test.pl");
                //pn.directory(new java.io.File("K:\\work"));
                java.lang.Process pr = pn.start();
                java.io.BufferedInputStream bis = (java.io.BufferedInputStream)pr.getInputStream();
                String tmp = new String("");
                byte b[] = new byte[1000];
                int i = 0;
                while (i != -1) {
                    bis.read(b);
                    tmp += new String(b);
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + tmp);
            } catch (java.io.IOException ex) {
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + ex.getMessage());
            }

    Hi Fonsi!
    One way to execute an external program is to use the System Exec.vi. You find it in the functions pallet under Communication.
    /Thomas

  • Row Selector - How to set onclick event handler?

    I have a master-detail set of forms and would like to respond to the onclick event of the row selector. When I go to the column attributes of the row selector I don't see anywhere to set the onclick event.
    The other tabular form elements have an "Element Attributes" field that I normally use, but the row selector does not. Am I simply missing something?
    I'm open to alternatives as well. The reality is, however, I don't need anything complicated or sophisticated. When the user clicks the box I gather some data from the current row and initiate an AJAX call. I don't need to submit the page, etc.
    Thanks,
    Brent

    I think that the only way to do that is to use the apex_item package like this:
    http://htmldb.oracle.com/pls/otn/f?p=31517:170
    The standard row selector doesn't have an option for attaching javascript code to it.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • HTTP Submit Button vs event.target.submitForm

    Dear All,
    I have a problem that looks like I would need some expert help to resove.
    I have designed a small Form with Acrobat LiveCycle Designer ES 8.2
    The plan is people to fill out the form and submit it to a script on a web page.
    Here is the problem.
    When I insert a regular HTTPSubmit button. Everithing is working just fine. All th fields are submited, and I can process them from there with my script.
    However, when I try to make a regular button and add javascript to the click event.
    event.target.submitForm({cURL: "http://mysite/myscript.php", cSubmitAs:"HTML", cCharSet:"utf-8"});
    The form is submited but non of the fields are.
    As an example output from REQUEST array in PHP.
    With the regular HTTP Submit button I get:
    Array
        [familyname] => 1
        [SubjectNumber] => 2
        [Site] => 3
    While with the above javascript I get:
    Array
        [form1] => Array
                [0] =>
    Looks like with the Javascript I somehow cannot submit the actuall fields.
    Finally, let me tell you the reason why I even want to use Javascript instead of the regular HTTP Submit button.
    My plan is so people can actually change the location where to submit the form.
    From what I read if I use a regluar submit button, the URL must be hardcoded and cannot be changed (selected, by the user dinamically)
    While if I use javascript then I can easily have a text field where people can enter the site where they want to submit the form and use it.
    Thank you very much for your help
    Please let me know if you need any further information
    Regards
    Tsvyatko

    Hey gays, thanks for answering.
    However, looks like I still have problems.
    When I insert a regluar HTTP submit button, it asks for the URL or it will give error.
    Anyhow, if I leave the URL setting blank, and try to execute the code u mentioned, I get a messege, "submit canceled" and nothing is happening,
    And if I enter something in the URL, looks like it still overites the code and submits the form the the hard coeded url.
    In addition, the regular submit button does not even allow me to enter code in the click even, so I did enterend in the mose in even,
    as to execute the code before the button is clicked.
    In addition I also tried to enter the even in a text field exit which I was hoping to use so the user can enter their own url.
    In other words.
    could please be more specific.
    On which even shown I enter the code.
    p.s.
    Finaly,
    in Form Calc
    If I enter this on the mouse enter of the button:
    form1.SCOPA_p2.HTTPSubmitButton1.event__click.#submit.#target = form1.SCOPA_p2.HTTPSubmitButton1_txt.rawValue;
    I get error accessor form1.SCOPA_p2.HTTPSubmitButton1.event__click.#submit.#target is unknown
    Any other thoughts
    Thanks
    Tsvyatko

  • Button's Event Handler Method not getting triggered

    To add a button I have written the following code:
    clear ls_button.
        l_import = 'Mass Upload'.
        l_enabled = 'X'.
        clear ls_button.
        ls_button-on_click = 'UPLOAD'. "IMPORT FILE
        ls_button-text     = l_import.
        ls_button-enabled  = l_enabled.
        INSERT ls_button INTO rt_buttons INDEX 5.
    Created a new Event Handler method for it and wrote the following code:
    gr_file_popup = comp_controller->window_manager->create_popup(
        iv_interface_view_name = 'ZSRQM_INCID_H/FileUploadwindow'
        iv_usage_name = 'ZCufileupload'
        iv_title = l_title ).
      gr_file_popup->set_on_close_event( iv_view = me iv_event_name = 'upload' ).
      gr_file_popup->open( ).
    When i run in th component in debug mode,my event is not getting triggered.
    Please suggest.
    Regards
    Najam

    Try the following code in first part...
    clear ls_button.
        l_import = 'Mass Upload'.
        clear ls_button.
        ls_button-on_click = 'UPLOAD'. "IMPORT FILE
        ls_button-text     = l_import.
        ls_button-page_id  = me->component_id.
        ls_button-enabled  = abap_true.
        INSERT ls_button INTO rt_buttons INDEX 5.

  • Htmlb:button  onClick event

    Hi experts I'm using follwoing code  for htmlb :button
              <htmlb:button       id            = "myButton2"
                                text          = "<%= v_save %>"
                               tooltip       = "<%= v_save %>"
                               onClick       = "approveClick"
                               design        = "emphasized"
           />
    and in
    do_handle_event  I'm using followin code
    DATA : button_event TYPE REF TO cl_htmlb_event_button,
             event1 TYPE REF TO cl_htmlb_event.
      event1 = cl_htmlb_manager=>get_event(  runtime->server->request ).
      CASE event1->server_event.
        WHEN 'approveClick'.
          button_event  ?= event1 .
    <   some code >
    ENDCASE.
    when i clicked the button it is not going into do_handle_event
    I'm unable to capture onclick event of button .I tried it by keeping some break points .But couldn't be ableto capture it
    Here I'm using MVC pattern .When one check box clicked in view of another controller  the page which contains this button will be displayed.Do i need to write any additional code for it

    There are 2 kind of break-points.
    1. Session break-points - This will wok only to debug normal ABAP codes.
    2. External break-points - This will help you to debug BSP/Webdynpro application.
    Set the external-break point to figure out whether its triggering the events or not.
    <b>
    To set the external Break-points:</b>
    Before settings the external-break-point, you need to Active External break-point for HTTP. YOu can find this option in
    SE80, in
    Utilites--> Break-point/External break-point or Utilites--> External break-point --> Set External break-point
    or if you dont find, then
    utilities-->setttings -> ABAP Workbench -> look at the debugger tab
    & find the external Debugging check box or External Debugging user ID. Give SAP User ID
    Also have a look at this..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/17/00ab3b72d5df3be10000000a11402f/frameset.htm
    <i>* Reward each useful answer</i>
    Raja T
    Message was edited by:
            Raja Thangamani

  • Another Javascript issue (CheckBox onClick event)

    Hello All,
    I am using NWDS04s Adobe Designer 7.1.
    I created a IF with a TextField on it and a CheckBox. What i would like to do is, when the checkbox is checked, the TextField should disappear (TextField1.Presence = "hidden").
    I wrote this script in the OnClick event of the Checkbox:
    if (CheckBox1.rawValue == "1") {
                TextField1.presence = "hidden";
    }else {
                 TextField1.presence = "visible";
    When i deploy my WD you could guess, it's not working ;-((
    Is there something i am doing wrong??
    When i place this code in the Initialize event of the CheckBox and change the If statement to CheckBox1.rawValue == "0" it works as expected.
    Hope somebody can help me or try it on there machines. Maybe it's a bug.
    Thx in advance.
    Kind Regards,
    Maarten

    Hello Maarten,
    Please have a look at method <a href="https://media.sdn.sap.com/javadocs/NW04s/SPS7/wd/com/sap/tc/webdynpro/clientserver/adobe/pdfdocument/api/IWDPDFDocumentInteractiveFormContext.html#setDynamic(boolean)">setDynamic</a> (interface IWDPDFDocumentInteractiveFormContext).
    Regards,
    Philipp

  • Use of A tag's href attribute vs. onClick event handler

    See
    http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/4d2e99b2a8bdbbd2/2d588fb34191a654
    The general consensus among all the gurus out there is that using the href=javascript: pseudo-protocol is baaaaad. Bad, bad, bad. It is proprietary, unreliable, undocumented and supported only for backward compatibility.
    HTML DB uses that all over the place. In fact, buttons and tabs use only href= "javascript:doSubmit(...)" to do their thing.
    I know that HTML DB makes no attempt to "degrade gracefully" on browsers which are not Javascript enabled. In other words, Javascript is a "minimum requirement" for running HTML DB, thats fine.
    But I know that Carl, Scott and the rest of the HTML DB team take "correctness" and standards-compliance very seriously.
    So, why was the decision made to use href=javascript: vs. onClick="..."?
    Thanks

    Hello,
    I never thought it was such a big deal either, you learn something new everyday.
    I don't know the particular reason that this was chosen in the first place. I do know it was chosen before 1.4 because it was already in there when I started on working on it, probably just evolved in this way overtime.
    It's always worked other than the few times I was trying to get the function someFunction(this) object and then I just move it to the onclick, after seeing that long and sometimes vicious thread on your googlegroups link you can guarantee it will be put on the list of things to look at for future fix's.
    Seem like it would make a good Tips and Tricks for the studio about moving it to the onclick in templates.
    Carl

  • Aps:button onClick event in Visual web part only fires first time - SharePoint 2013

    Below is my markup from ascx file
    <asp:Button ID="exporttopdf" runat="server" Text="Export To PDF"/>
    C# code for button on click
    protected void Page_Load(object sender, EventArgs e)
    exporttopdf.Click += new System.EventHandler(this.exporttopdf_Click);
    protected void exporttopdf_Click(object sender, EventArgs e)
    if (Page.IsPostBack)
    try
    using (MemoryStream stream = new MemoryStream())
    PdfPCell cell;
    SPList list = SPContext.Current.Site.OpenWeb().Lists[this.ListName];
    BaseColor rGBColor = WebColors.GetRGBColor("#AFAECE");
    PdfPTable element = new PdfPTable(2)
    TotalWidth = 300f,
    LockedWidth = true
    float[] relativeWidths = new float[] { 1f, 2f };
    element.SetWidths(relativeWidths);
    element.HorizontalAlignment = Element.ALIGN_MIDDLE;
    element.SpacingBefore = 20f;
    element.SpacingAfter = 30f;
    if (this.PdfHeading != null)
    cell = new PdfPCell(new Phrase(this.PdfHeading));
    else
    cell = new PdfPCell(new Phrase(this.ListName));
    cell.Colspan = 2;
    cell.Border = 0;
    cell.Padding = 4;
    cell.BackgroundColor = rGBColor;
    cell.HorizontalAlignment = 1;
    element.AddCell(cell);
    Document document = new Document(PageSize.A4, 25f, 25f, 30f, 30f);
    PdfWriter instance = PdfWriter.GetInstance(document, stream);
    document.Open();
    document.AddAuthor("Place Holder");
    document.AddCreator("Place Holder");
    document.AddKeywords("Place Holder");
    document.AddSubject(this.ListName);
    document.AddTitle(this.ListName);
    instance.Info.Put(new PdfName("Producer"), new PdfString("Place Holder"));
    PdfContentByte directContent = instance.DirectContent;
    string[] separator = new string[] { ";", "," };
    string[] strArray2 = this.ViewFields.Split(separator, StringSplitOptions.None);
    new StringBuilder().Append(this.ListName + "\n");
    foreach (string str in strArray2)
    PdfPCell cell2 = new PdfPCell(new Phrase(str))
    Border = 0,
    Padding = 4,
    HorizontalAlignment = 1
    element.AddCell(cell2);
    if (str != "Modified By" && str != "Created By")
    PdfPCell cell3 = new PdfPCell(new Phrase(SPContext.Current.Item[str].ToString()))
    Border = 0,
    Padding = 4,
    HorizontalAlignment = 1
    element.AddCell(cell3);
    else
    string[] separatorc = new string[] { "," };
    string[] strArray3 = SPContext.Current.Item[str].ToString().Split(separatorc, StringSplitOptions.None);
    PdfPCell cell3 = new PdfPCell(new Phrase(strArray3[3].ToString().Substring(8).Replace(@"\\", @"\")))
    Border = 0,
    Padding = 4,
    HorizontalAlignment = 1
    element.AddCell(cell3);
    PdfPCell cell4 = new PdfPCell(new Phrase("Footer"))
    Colspan = 2,
    Border = 0,
    Padding = 4,
    BackgroundColor = rGBColor,
    HorizontalAlignment = 1
    element.AddCell(cell4);
    document.Add(element);
    document.Close();
    instance.Close();
    stream.Close();
    HttpContext.Current.Response.Clear();
    HttpContext.Current.Response.ContentType = "pdf/application";
    string filename = SPContext.Current.Item["Title"].ToString() + ".pdf";
    HttpContext.Current.Response.AddHeader("content-disposition", "inline;filename=" + filename);
    HttpContext.Current.Response.OutputStream.Write(stream.GetBuffer(), 0, stream.GetBuffer().Length);
    HttpContext.Current.Response.End();
    catch (Exception exception)
    SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("Export To PDF", TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, exception.Message, new object[] { exception.StackTrace });
    else
    HttpContext.Current.Response.Write("<script language=javascript>alert('ERROR');</script>");
    it works fine first time but does not do anything from second.
    any advice?

    Hi,
    Please try to the code snippet as below:
    VisualWebPart1.ascx:
    <asp:Button ID="exporttopdf" runat="server" Text="Export To PDF" OnClick="exporttopdf_Click"/>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    VisualWebPart1.ascx.cs:
    protected void Page_Load(object sender, EventArgs e)
    protected void exporttopdf_Click(object sender, EventArgs e)
    Label1.Text = System.DateTime.Now.ToString();
    If the code still do not work from second, I suggest you debug your code and check whick line of code occur the error.
    More information:
    http://social.msdn.microsoft.com/Forums/office/en-US/94931a08-f204-4d30-a230-f468815a76e8/export-aspnet-gridview-to-pdf-from-visual-webpart?forum=sharepointdevelopmentprevious
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Javascript embedded in button pl/sql event handler not being executed

    Javascript calls not working from pl/sql button event handler. What am I missing? Are specific settings needed to execute javascript from pl/sql proceedures?
    Example: Want to toggle target='_blank' off and on in a button pl/sql event handler to open url call in new window & then reset when processing submit is done & the app returns to the form.
    portal form button's pl/sql submit handler:
    begin
    htp.p('<script language=JavaScript>') ;
    htp.p('this.form.target="_blank"') ;
    htp.p('</script>') ;
    PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
    htp.p('<script language=JavaScript>') ;
    htp.p('this.form.target="_blank"') ;
    htp.p('</script>') ;
    end ;
    Putting the following in the button's javascript on_click event handler works great:
    this.form.target='_blank'
    to force opening new window with a call in the button's submit pl/sql code via:
    PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
    but then the target='_blank' is left on when the submit is done & we return to the form.
    putting the above javascript as a function (called fcn_newpage) elsewhere (e.g., after form opens) & calling in the submit pl/sql with
    htp.p('fcn_newpage') ;
    also doesn't work.
    Metalink thought this was an application issue instead of a bug, so thought I'd see if anyone knows what's going wrong here. (Portal 9.0.4.1)

    thanks for your discussion of my post.
    Please clarify:
    "htp.p('fcn_newwindow') sends a string":
    What would you suggest the proper syntax for a function fcn_newwindow() call from a pl/sql javascript block that differs from
    htp.p('<script language="Javascript">') ;
    htp.p('fcn_newwindow');
    htp.p('</script>');
    or more simply
    htp.p('fcn_newwindow') ;
    More generally, what I'm trying to figure out is under what conditions javascript is executed, if ever, in the pl/sql of a button (either the submit or custom event handler, depending on the button).
    I've seen lots of posts asking how to do a simple htp.p('alert("THIS IS TROUBLE")') ; in a pl/sql event handler for a button on a form, but no description of how this can be done successfully.
    In addition to alerts, in my case, I'd like to call a javascript fcn from a pl/sql event handle that would pass a URL (e.g., http://www.oracle.com) where the javascript fcn executed
    window.open(URL). The API call to set_target(URL) in pl/sql has no ability to open in a new window, so calling that is inadequate to my needs and I must resort to javascript.
    Its clear in the PL/SQL of a button, you can effect form components since p_session..set_target & p_session.get_target set or get the contents of form components.
    So to see if javascript ever works, I tried to focus on something simple that only had to set what amounts to an enviromental variable when we returned to the form after a post. I chose to try to change the html value of TARGET from javascript in the PL/SQL button because it doesn't need to be implemented until we finish the post and return to the form.
    So I focused on a hack, setting this.form.TARGET='_blank' in the on_click event handler that forced every subsequent URL call or refresh of the form to be a new window. I then wanted to turn off opening new windows once I'd opened the URL call in a new window by setting TARGET='' in the portal form. I can achieve what I want by coding this.form.TARGET='' in the javascript (on_focus, on_change, or on_mousedown, ...) of every form component that might refresh the form. However, that is a ridiculous hack when a simple htp.p('<script>') ; htp.p('this.form.target=""') ; htp.p('</script>') ; at the end of the button's pl/sql event handle should do the same thing reliably if javascript ever works in the pl/sql event handler.
    If we didn't have access to form components through p_session calls, I'd assume it was a scope issue (what is available from the pl/sql event handler). But unless my syntax is just off, when, if ever, can javascript be used in a portal form's pl/sql event handler for a button?
    if I code a javascript funtion in the forms' pl/sql before displaying form:
    htp.p('<script language="JavaScript">') ;
    htp.p('function fcn_new_window(URL)') ;
    htp.p('window.open(URL)' ) ;
    htp.p('</script>') ;
    the function can be called from a button's on_click javascript event handler:
    fcn_new_window('http://www.oracle.com')
    but from the same button's pl/sql submit event handler this call doesn't work: htp.p('fcn_new_window("http://www.oracle.com")')
    So my questions remain: Is there other syntax I need, or does javascript ever work properly from the pl/sql of a form button's event handler? If it doesn't work, isn't this a bug that should be fixed by Oracle?
    I can probably figure out hacks to make things work the way I need, but executing javascript from pl/sql event handlers seems to be the expected way to affect portal html pages (forms, reports, ...) and it seems not to work as expected. I don't feel I should have to implement hacks for something as simple as calling a javascript function from pl/sql when almost every example I've found in metalink or the forums or Oracle Press's "portal bible" suggests using javascript from pl/sql via the utility htp.p() to effect web page components in portal.
    My TAR on the subject, while still open, returned the result basically: "We can reproduce your situation. Everything looks okay to us, but we can't explain how to use javascript where you want or point you to any documentation that would solve your problem or expain why it should not work the way you want it to. We don't feel its a technical issue. Why don't you post the problem on the portal applications forum."
    I'm hoping I'm just missing something fundamental and everything will work if I implement it a little differently. So if anyone sees my error, please let me know.
    by the way, not sure this is germain, but in reference to your comment:
    "redirections in pl/sql procedures give a peculiar result. in a pl/sql procedure, usually, portals give the last redirection statement and ignore anything else coming after it."
    if I try to raise an alert:
    htp.p('alert("you screwed up")');
    return;
    in a pl/sql event handler, it still doesn't raise the alert, even though its the last thing implemented in the event handler. But if I set the value of a text box using p_session..set_value_as_string() at the same spot, it correctly sets the text box value when I return to the form.

  • Handling Submit Button on the ADOBE form called from Web Dynpro

    Hi,
    I have placed a Button on the ADOBE Form. How to Handle the event on this button. When i click this button, i want to save the details of the form into a Custom table.

    Hi Majunath.
    Create an event say, SUB_EVTin the view in WD where you have the Interactive Form UI element.
    Bind this event to the onSubmit of the Form.
    Now check the display type of the form. It will be either ActiveX or Native.
    Now go to the form designer and open Library palette. Navigate to Webdynpro ActiveX or Native Library(Depending on the form display Type in WD).
    Drag and Drop Submit button.
    On click of the button, the event handler in WD view namely, onActionsub_evt will be invoked. You can write your code in this handler.
    Now in order to read data from the form. Go to the form and go to Properties tab. Check the form layout type. If it is not ZCI, run transaction SFP_ZCI_UPDATE and convert the form to ZCI type.
    Now back to the event handler.
    as an example... I will use the following context node definitions
    PDF_DATA  1..1
      ACTUAL_DATA 0..n
        ATTRIB01
        ATTRIB02
    Assume the the node PDF_DATA is bound to the data source of your form.
    Now in the event handler write the foll code
    data: lo_node type ref to if_wd_context_node,
            lt_data   type wd_this->elements_actual_data.
    lo_node = wd_context->get_child_node( name = wd_this-.wdctx_pdf_data ).
    lo_node = lo_node->get_child_node( name = wd_this-.wdctx_actual_data ).
    lo_node->get_static_attributes_table(
      importing
        table = lt_data ).
    This will get all the form data in the internal table lt_data.
    Now you can process the data the way you want and save it in your custom tables.
    Regards,
    Reema .
    Edited by: Reema Shahbazkar on Sep 16, 2008 11:39 PM
    Hope this helps!!

  • How can i disable a submit button and execute submit_action method on click

    Good Day,
    On my page I have a submit button that execute the submit_action method of the page backing bean that submit data captured on the page into a database and activate another class that send mail at the same time on a click of the submit button,the mail process takes a while before returning back to the page.I was able to disable the submit button to prevent the user from keep click while the process is running but the issue is on clicking the submit button it only disable the submit button without executing the submit_action method of the page backing bean.How can i disable the submit button and execute submit_method of the backing bean at the same time.
    Thanks in advance.

    I tried this out on one of my pages to see if it works.
    First, I added the following JavaScript to my submit button's onClick event:
    this.disabled=true; return true;When I clicked the submit button, it was disabled but the form was not submitted.
    I deleted the JavaScript from the onClick event and added the following JavaScript to the form's onSubmit event:
    var button = document.getElementById("form1:submitButton"); button.disabled=true; return true;When I click the submit button, it was disabled and the form was submitted but the button's action method was not called.
    The next thing I tried was to change the onSubmit event code:
    var button = document.getElementById("form1:submitButton"); setTimeout("button.disabled=true", 500); return true;This seemed to work. The difference was that I added a 1/2 second delay before disabling the button.
    See if that works for you. If not then I'm fresh out of ideas.

  • Problem in submit button on adobe form integrated with web dynpro

    Hello,
    I'm facing prob in triggering web dynpro event onSubmit for Interactive form.
    I've created a submit button from web dynpro activex pallete on adobe form (integrated with web dynpro) to send the form as email.
    Then in the web dynpro view where this form is embedded i have created an action against onSubmit event and called a method within this.
    However, on clicking Submit button this event is not getting triggered.
    Please let me know what is lacking in this process?
    Thanks.

    Hi,
    I am also facing the same problem. i have developed a simple scenario under which user have to input his/her details and on submit button it will be updated to database.
    I have tried the above solution but after adopting this solution all the editable fields become non-editable.
    so the above solution is not working for me could you help me out.
    I think ... try this....
    When you create the Adobe Form from WebDynpro, you need to follow one step in SFP Transaction or inSE80 transaction. Open the Adobe Form in any one the transaction and now in SAP menu bar "Utilities" in that you will find the "INSERT THE WEBDYNPRO SCRIPT" just click on that one. Then you will see a new Script Object is being created with the name "ContainerFoundation_JS" under the "Variables" in the Heirarchy of the Object Pallete of the Adobe Form.
    This step is mandatory to use the SUBMIT Button of the "WebDynpro Native", to trigger the OnSubmit event of the WebDynpro.
    Thanks
    Edited by: shailendra2sap on Mar 6, 2009 12:24 PM

  • Associating two events with submit button using  javascript in jsp

    Hi
    How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up window

    Have something like :
    <input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
    You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky.

Maybe you are looking for

  • Unable to install Directory Sync tool in windows server 2008 R2 Eneterprise

    Hi, I am unable to install Directory Sync  in windows server 2008 R2 Eneterprise.i have joined my machine domain joined computer running Windows Server 2008 r2 enterprise,when i click dirsync.exe then gives below Error. The Windows Azure Active Direc

  • Need full resolution HDMI audio and 2 CH optical simultaneously

    Am working on an install for a customer who has a Mac Mini.  He is running XBMC for all his movies.  I need to run HDMI to his surround processor with full resolution audio while running the optical out in 2 channel pcm for his whole house audio.  Is

  • Comping several tracks at once... how can I use quick swipe edit?

    Hi Guys, We've just recorded a piano over two stereo tracks, now it's comping time. We don't want to comp the tracks seperately... is there a way to link the two tracks so the swipe-comping we do will be reflected in both? I'm sure there's an option

  • Does anyone know what this means?

    I've been trying to download PS via the CC Dashboard. It's annoying that the download keeps failing as I have paid for my subscription... Thanks! Exit Code: 7 Please see specific errors below for troubleshooting. For example, ERROR: DF024 ... -------

  • Custom SAPUI5 app in Fiori launchpad - wrong resource path

    Hi, I have successfully add custom tile for my custom  app to Fiori launchpad, when the application is run from its location (https://<server>:<port>/sap/bc/ui5_ui5/sap/zcart3/index.html) everything is ok, when I try to execute it from Fiori launchpa