Struts submit button focus

Hello
I have following prob:
a form with three buttons
a submit (normal html-button)
a cancel (struts html:cancel button)
and a reset (struts html:reset button)
since I need javascript to run before submitting
and after the result of the javascript function deciding if submiting or not I used a submit html-button (I cannot stop the struts html:submit button from submitting even if a put a javascript onClick after the javascript function comes the submition (is there a way to stop it?)).
For the other two buttons the struts html tags.
Now if the user press enter (regardless where the focus is in the form) the cancel action is being activated (the form cancelled)
if I use javascript to put the focus on submit, as soon as the user click on a text field (or any other form component) the "button group focus" moves to the cancel button!
(regardless where was the focus is in the form)
How can I get the "enter key focus" staying on submit?
I already tried the struts <html:form ... focus="submitButton"> and it works at page-load-time BUT as soon as the user click on a text field (or any other form component) the "button group focus" moves to the cancel button ! ! !
Is there a kind of "enter key" focus which works independent from the fields focus?
Thanks!

The regular way to cancel a javascript action is to return false from the onclick event.
I don't see any reason it wouldn't work with html:submit
ie
function checkSubmit(){
  if ( checkIsOk){
    return true;
  alert("You got it wrong moron!");
  return false;
<input type="submit" onclick="return checkSubmit()">

Similar Messages

  • When i placed a AccessKey to Submit Button (Eg: AccessKey="S"), and pressed Shift + Alt + S, the focus is going to Submit button and as well as Submit operation is also performed. Is this the expected behaviour in FireFox for AccessKeys

    When i placed a AccessKey to Submit Button (Eg: AccessKey="S"), and pressed Shift + Alt + S, the focus is going to Submit button and as well as Submit operation is also performed. Is this the expected behaviour in FireFox for AccessKeys

    What were you expecting when using an accesskey?
    I use that also on this forum to submit my posts:
    <pre><nowiki><input accesskey="s" class="btn btn-important" value="Post Reply" type="submit">
    </nowiki></pre>

  • Submit Button in a Struts Form

    Hallo,
    in a fom I have 2 submit buttons the Value of the first is "new" and the secound is "Edit"
    who can one get in the Action class whicht button has klick the user
    <html:form action="/SubmitUserSelection">
    <table width=100% cellpadding=0 cellspacing=0 border=0>
    <tr height="30">
         <td width="95"><html:submit property="submit" value="New"/></td>
         <td width="95"><html:submit property="submit" value="Edit"/></td>
    <tr>
    </table>
    public ActionForward execute(ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception {
    thanks

    http://struts.apache.org/userGuide/building_controller.html#action_form_classes
    make sure you add a field and setter getter for your submit button

  • How to set focus on MessageTextInput after clicking submit button

    Hi All,
    I have submit button and MessageTextInput, by clicking submit button i have to focus on MessageTextInput control.
    can any one tell me how to do this?
    Thanks
    Laukik Pachanekar

    Hi,
    As the submit button is clicked redirect the page to itself using
    pageContext.forwardimmediatelytocurrentpage(null,false,null);
    Now in process request use:
    import oracle.apps.fnd.framework.webui.beans.OABodyBean;
    OABodyBean oabean = (OABodyBean)pageContext.getRootWebBean();
    oabean.setInitialFocusId("<id of messsage text input>");
    Thanks,
    Gaurav

  • Htmls:submit buttons and links in struts

    Hello,
    I am developing a struts web application. In the course of that I have two questions:
    How can I define an image to display for a html:submit button instead the traditional visualization of the html:submit button?
    The same for links - How can I define an image for a link?
    thanks in advance
    Kind Regards
    pat

    How can I define an image to display for a
    html:submit button instead the traditional
    visualization of the html:submit button?
    The same for links - How can I define an image for a
    link?
    <html:image>

  • How to open a new window from submit button &dialog page in current window?

    We have a requirement, wherein we have a OAF search page for PO lines with search criteria, Go button to search ,result region (table layout) and a submit button(Create new expedite).
    1. Now user can select some lines from result region and click on Submit button.
    2. On click of submit button we need to pop up a window or may be a dialog page asking that " Do you want open supplier web link portal or not?".
    3. If user clicks yes(in Dialog page) then first fetch the URL from a look up maintained in Oracle EBS on the basis of supplier of the lines selected and then open that URL in a new window and side by side we need to open a dialog page in search page asking "whether user has updated the expedite info in supplier portal or not?". On basis of this we need to updated some count in custom tables.
    So in step 3 i am facing problem, that how to open an URL in a new window through a submit button and side by side want to open a dialog page in the current window also.
    Hope a quick response from you all.
    Note:- To open a custom page we can have a link or button(button of type button and not submit button) on base page with destination url property as following javascript:
    javascript:var a = window.open('OA.jsp?page=/XXX/oracle/apps/xxx/......&retainAM=Y', 'a','height=500,width=900,status=yes,toolbar=no,menubar=no,location=no'); a.focus();
    So the question is how to do the same for submit button on OAF page???

    Antriksh,
    You just need to attach a submit action in button bean and not submit button bean, based on the output of confirm type of alert in javascript.
    Here is code u need to put in destination url of the button:
    //replace <confirm message> by message you want to show.
    javascript:input=confirm('<confirm message>');if(input==true){submitForm('DefaultFormName',0,{XXX:' abc'});}" Now in the process request of the base page CO, u can get parametre 'XXX' from the pagecontext....so
    if((("abc").equals(pageContext.getParameter("XXX"))))
    {/// custom LOGIC }
    The same i have replied in your mail. I hope this resolves the issue.
    --Mukul

  • Multiple submit buttons in a jsp form?

    I've been doing some research and found out that multiple buttons in a JSP form are possible by two ways:
    - We can obtain the value of the submit button to know which one was clicked in the parameters of the request using the name of the buttons (which should be the same for all the submit buttons).
    - We can change the submit destination using Javascript (Horrible solution since I want my web site to be safe to be used even if Javascript isn't active in clients browsers. I will use it of course since we can do amazing things with it but I want my website to be able to work without it also)
    WHAT annoys me is the fact that the value of a submit button is also his text, so if I change the text of the submit button, I will always have to check the servlet to do the corresponding change.
    Is there a third choice to be able to use multiple buttons?
    Olivier Voutat

    It seem rather convoluted at first but it's really good. I've not worked with JSF so I've no idea how that compares but from what I know, Craig McClanahan, who came up with Struts, worked on JSF also, so I guess it could only improve on Struts.
    EDIT: Here's a search result on Google'ing his name: http://www.theserverside.com/news/thread.tss?thread_id=29068
    But like I said, you don't have to use Struts ( which only uses standard JSP/ Servlets stuff anyway ), you simply use one of the ideas from it.
    For example; you have a properties file, say "/WEB-INF/properties/myProps.properties" with these entries:
    #USERS MODULE
    users.button.save=Save User
    users.button.search=Search User By Name
    users.button.delete=Delete UserThis would be a key: users.button.save to the value Save User
    Now, in your JSP, you use JSTL <fmt> tags:
    <fmt:setBundle basename="properties.myProps"/>
    //set the resource bundle you want to use
    //and create buttons with the proper values
    <input name="myButton" type="submit"><fmt:message key="users.button.save"/></input>
    <input name="myButton" type="submit"><fmt:message key="users.button.search"/></input>This would create buttons with text "Save User" and "Search User By Name" respectively
    Now, finally, in your servlet:
    //create a map of the properties,
    //possibly on app startup using a ServletContextListener
    //and put it in the servlet context for access everywhere
    HashMap myProps = (HashMap)getServletContext.getAttribute("myPropertiesMap");
    String buttonClicked = request.getParameter("myButton");
    if ( buttonClicked.equals((String)myProps.get("users.button.save")) )
    //perform save action
    else if ( buttonClicked.equals((String)myProps.get("users.button.search")) )
    //perform search action
    //etcYou'll obviously want to optimize this. Perhaps make a method that handles the comparison so you can have neater if conditions. But you get the idea, right?
    Edited by: nogoodatcoding on Oct 4, 2007 8:12 PM

  • How to apply style to submit button

    Hi All,
    I am developing an application in struts where I have multiple buttons on a single form. Each button corresponds to different action to be executed, and to achieve this I have used DispatchAction.
    Since I need to submit the data, I am looking for some ways through which I can put some style on submit button, such as putting an image over the submit button,giving it some border, some color and so on. I want to do this through CSS or if not possible through CSS then as inline style.
    I am using struts-html.tld tag library to render all the HTML controls.
    Any idea how to put images over submit buttons, or if putting an image is not possible then how to have style for it so that the look of submit button changes and the user feels as if it is a graphic button.
    Any help is appriciated.
    Thanks.

    You do realise there is an <html:image> tag which
    generates the html graphical submit button (ie <input
    type="image">) ?
    There are two tags in struts:
    <html:img> - generates an image tag: <img src="...">
    <html:image> - generates a graphical submit buttonYea, I do know this. But the problem is I don't have one submit button in my page. There are mroe than one buttons and each button calls a different method of the Action class. I could not get a way to pass the parameter name and parameter value using
    <html:image> tag.
    To be more clear, I need CRUD operations in one page and they all refer to one Action class. If I use html:image tag, I can't call seperate functions as it will then call the execute method. Also I don't want to have any javascript to call the relevant method from the Action class.
    Is there any way out? I am not a pro in struts, just s beginner, so any help is more than appreciated.
    Thanks.

  • Image as Submit button

    Does anyone know how to use an image as a Submit button, using Struts?

    I think you're looking for the <html:image> tag. It creates an input tag of the "image" type. Make sure it's nested in <html:form> tags, or it won't work.
    http://jakarta.apache.org/struts/userGuide/struts-html.html#image
    Good luck!

  • Jsp Submit button

    Hi,
    I am using a two submit buttons in my jsp, inside a form.
    I am using struts, and when i click one submit button i need it should open a new window.
    How can i use url so that it will also using action mapping..
    My code is..
    <html:submit property="workManagementButton" onclick=window.open('/manageWorkItem.do?action=init','mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0')><bean:write name="alert" property="alertId"/></html:submit>
    but i can't open a new window with this code..
    Can any one help how i can moidify the above code..

    <logic:notEmpty name="alertForm" property="alerts">
         <logic:iterate id="alert" name="alertForm" property="alerts">
              <tr>
              <td>
                   <div align="center">
                   <html:multibox property="selAlertIds">
                   <bean:write name="alert" property="alertId"/>
                   </html:multibox>
                   </div>
              </td>
              <td>
                   <div align="center"><bean:write name="alert" property="alertLocalTime"/></div>
              </td>
              <td>
                   <div align="center"><bean:write name="alert" property="segmentSN"/></div>
              </td>
              <td>
                   <div align="center">
                        <html:multibox property="selMangedAlertIds">
                        <bean:write name="alert" property="alertId"/>
                        </html:multibox>
                   </div>
              </td>
              --%>
              <td>
              <div align="center">
              <bean:write name="alert" property="alertWorkItem"/></div>
              </td>
              <td>
                   <div align="center">                
                   <html:submit property="viewTrendButton"><bean:write name="alert" property="alertId"/></html:submit>
                   </div>
              </td>
              <td>
                   <div align="center">                
                   <html:submit property="viewPatternButton"><bean:write name="alert" property="alertId"/></html:submit>
                   </div>
              </td>
              <td>
                   <div align="center">
                        <html:submit property="workManagementButton" onclick=window.open('/manageWorkItem.do?action=init','mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0')><bean:write name="alert" property="alertId"/></html:submit>
                   </div>
              </td>          
              </tr>
         </logic:iterate>
         </logic:notEmpty>
    The above code is inside a form..
    So when i click workManagementButton it should open a new window and go through action mentioned..
    it is going through the path but i can't open a new window with above code..
    Can you please suggest..

  • Submit Button In IE

    Hi
    I am using the following stylesheet code to change the
    appearence of my submit buttons, however when the border is set to
    1px I keep getting an additional border whcih appears outside of
    the one I have set. This happens in IE7 (I think that type=submit
    only works in IE/Firefox, I guess I will have to go round and
    update the class of each button eventually :S) but not in Firefox.
    Is there a solution to this? I want IE7 to only show my
    border, not to add its own outside of the one I have added.
    input [type=submit]{
    border: 1px #FA0029 solid;
    background-image: url('bkg.jpg');
    Thanks everyone for the help.

    Thanks iwasjoeking
    I tried that but it did not seem to work. I also discover,
    through having about 10 buttons on the page at once, the black
    border is a result of the button being on focus. What was weird
    though is that one button always seems to have a border around even
    if a text box has the focus of the mouse, and only moves of the
    button if you select another button.
    I tried something like:
    input[type=submit]:focus{ border: 1px #FA0029 solid; }
    but that did not seem to work.
    I dont know if anyone else has found this but it is very
    annoying as it does spoil the appearence of the page.
    Thanks again

  • Cascading lists without submit button

    hi all:
    i followed the tutorial for building cascading lists and it works but i need that the detail list will be updated automatically when i change the master list without using a submit button, can anyone tell me how this could be implemented.
    Best Regards

    An example is here:
    http://www.oracle.com/technology/products/jdev/howtos/10g/StrutsValidator/struts_validator_howto.html
    I've never taken it any further than that.
    We opted for a button beside the field [Refresh], with an onRefresh event in a dataforwardaction, but we're using ADF BC/Struts/JSPs. If struts validator is in place, then you need to "short-circuit" the validator at this point, or you'll get a stack of errors that you may not want. Or you could always override the validate() method and filter them out when you see the event_Refresh button was pressed.

  • How do I create multiple TEBs with one submit button on one page in Captivate 7

    I've read other posts on this topic (which refer primarily to earlier versions of Captivate) and am still at a loss as to how to put multiple text entry boxes on a page with one submit button. Here's my scenario:
    I am creating test questions.
    Each test question has multiple text entry boxes (for numbers only).
    Student should be able to enter numbers into the textboxes in any order.
    Then there is one Submit button that should initiate validating all the text entries, and move to a scoring page (so I can test it). (What would be best is if this button not only did the above, but also submitted scores to the LMS.  But that is not my question at this time.)
    I'd like this question to be set up as a template so that I can duplicate it, be able to add or delete text boxes and change the values required in the text boxes.  
    Here is an image of a sample question page with multiple TEBs. The yellow boxes tell the student where they need to enter text:
    Any help or direction to help is appreciated!!

    I think the problem here is that Arlhoolie wants all of the different TEBs to behave as if they were part of a single interaction that submits only ONE result to the quiz.  Using multiple TEBs in Captivate means that you have multiple scored objects and therefore multiple results being submitted to the quiz.
    If you want a single Success or Failure result submitted to the quiz based on the results from multiple interactive objects then there really is no simple way to do it.  But you could try using the Infosemantics Interactive Master widget to combine all the TEBs as slave objects that report to the Master Widget, which then reports a single score to the quiz based on the results from the slave objects.
    You can learn more about the Master widget here:
    http://www.infosemantics.com.au/adobe-captivate-widgets/interactive-master
    http://www.infosemantics.com.au/interactivemaster/help
    You can download a free trial version of the widget here:
    http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets
    One caveat you should be aware of is that this widget is not HTML5 compatible.

  • In LIVECYCLE DESIGNER how do I code a submit button to only submit one page of a multipage PDF

    I have a multipage PDF I've designed in Livecycle and have print and submit buttons on each unique form in the document. I am able to create code (which I've copied from someplace) that allows only one page to print but when I click the submit button it wants to submit the entire document.  PS - I created the Submit from the blank button and have it set to submit PDF not XML.

    I don't think you can submit just a page of your PDF like you printed just a page. The difference is that when you print, the PDF becomes dots on paper, while when you submit a PDF it must remain completely intact to be machine readable, especially since the forms on a LiveCycle (XFA) document can have complex dependencies between pages.

  • How can you get your submit buttons to be a single click instead of the default double click?  (The

    How can you get your submit buttons on the quiz template to be a single click instead of the default double click?  (The option to choose double click or not is not showing in properties for this).

    Hmmm... Submit button doesn't need a double click at all. Maybe you are talking about the two-step process? When you click on Submit, the feedback appears with the message to click anywhere or press Y. Is that what you are talking about? If you are talking about a real double-click, something must be wrong in your file. And which version are you using?
    http://blog.lilybiri.com/question-question-slides-in-captivate
    Lilybiri

Maybe you are looking for

  • What went wrong in the Voyager Connection

    Hi,    We installed Business Objects XI 3.1. We have SAP BW7.1 patch5. Only ABAP stack is installed. Xcelisus2008 SP2, Crystal Reports2008, Business Objects Enterprise XI 3.1 SP00, SAP Integration Kit, are installed in the specified order. BW and BO

  • 2010 Mac Mini power cord loose? and Abode flash player bad??

    Just received new 2010 Mac Mini 2 days ago. It looks different and better features than old Mini I had. I am happy with newer Mini. Problem: The power cord loose and not good plug in. Need replace newer the power cord. Who I should contact to or go a

  • Why does my new iPhone 5s screen go black?

    I just got this phone in December, and recently the screen has been going black for awhile.  When it's black, I can still hear vibrations when I get a text message or the siri beeping when I hold down the Home button.  I try restting it, but that doe

  • How can I add new artwork like backgrounds & graphics, to the content list??

    I would like to add some of the images that i have created to the list of backgrounds, graphics etc under the Content-> Artwork lists. How can i do this?

  • RSS Visualizer missing from 10.4.11-help?

    I have an iBook G4 with OS 10.4.11 loaded and RSS Visualizer is an option in the Preferences/Screensaver window. I also have an iMac G3 600MHz (Snow) running 10.4.11 as well and fully updated using Software Update as far as it would go. But RSS Visua