Select tag with JavaScript function

I am using a selectOneMenu tag for navigation. After the selection I use a button to go to the selected page. I would prefer to go to the selected page without using an additional button. I think I have to use a JavaScript function with the attribute "onchange". How does this JavaScript function look like?

I use something like this, it works fine
<h:selectOneMenu id="selectedEndorsement" valueChangeListener="#{engageListServiceBean.changeEndorsement}" value="#{engageListServiceBean.selectedEndorsementNum}" onchange="submit()">

Similar Messages

  • Need for help in select tag with jsp

    i have a select tag about shoeing countriesin a register form and according to the selection of country i want to shoe the names of its cities .............i guess it has something to so with js and i have a little experience in it
    ..........................................if somebody have the answer i'll b thankfull 4 this

    <%@page import="java.sql.*"%>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>register</title>
         <SCRIPT LANGUAGE="JavaScript">
         function checkForm(form){
                        var len = form.elements.length;
                   for (var i = 0; i < len; i++)
                                       if ((form.elements.value == null || form.elements[i].value == ""))
                                                 alert("Please enter your " + form.elements[i].name + ".");
                                                 form.elements[i].focus();
                                                 return false;
                                       return true;
         </SCRIPT>
         <script>
                   function subForm()
                        frm=document.forms.register;
                        frm.action="register.jsp";
                        frm.submit();
         </script>
    </head>
    <body>     
              <H3>WELCOM IN REGISTER PAGE </H3>
              <table align="center" border="0"width="100%">
                   <form name="register" method="post"action="reg.jsp">
                        <tr>
                             <th>
                             Country
                             </th>
                             <td>     
                             <select name="country" onChange="subForm()" >
                             <option value="-1">choose</option>
                                  <%!private Statement stmt;%>
                                  <%!private ResultSet rs;%>
                                  <%!private String h;%>
                                  <%!private int s;
                             private int s2;
                                  private String b;%>
                                  <%
                                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                  Connection conn = DriverManager.getConnection("jdbc:odbc:data", "", "");
                                  stmt=conn.createStatement();%>
                                  <%
                             b= request.getParameter("country");
                             rs = stmt.executeQuery(" select* FROM Country");
                             Integer int3=java.lang.Integer.valueOf(b).intValue();
                             s2=int3;
                             if(s2!=-1)
                                  while(rs.next())
                                  %>
                             <option value="<%=rs.getInt(1)%>">
                             <%=rs.getString("Country_name")%>
    </option>
                                  <% }     %>
                                       <%
         h=request.getParameter("country");
    Integer int1=java.lang.Integer.valueOf(h).intValue();
    s=int1;
    }else{
                             rs = stmt.executeQuery(" select* FROM Country where country_id='"+s2+"'");
                        if(rs.next())
                                  %>
                             <option value="<%=rs.getInt(1)%>">
                             <%=rs.getString("Country_name")%>
    </option>
                                  <% }     %>
                                  <% }     %>
                                       </select>     
                             </td>
                   </tr>
                   <tr>
                             <th>
                                  City
                                  <br>
                             </th>
                             <td>
                             <select name="city">
                                  <option value="-1">choose</option>
    <%
                                  rs = stmt.executeQuery(" select* FROM City where Country_id='"+s+"'");
                                  while(rs.next())
                                  %>
                             <option value="<%=rs.getInt(1)%>"><%=rs.getString("City_name")%></option>)
                             <%
                             out.println(request.getParameter("City"));
                             %>
                             </select>     
                             </td>
                             </tr>
                             <tr>
                                  <th>First Name</th>
                                  <td><input type="text"name="firstName" size="30"></td>
                        </tr>
                             <tr>
                                  <th>Last Name</th>
                                  <td> <input type="text"name="lastName" size="30"></td>
                             </tr>
                             <tr>
                                  <th> Email </th>
                                  <td><input type="text"name="email" size="30"></td>
                             </tr>
                             <tr>
                                  <th> UserName </th>
                                  <td><input type="text"name="userName" size="30"></td>
                             </tr>
                             <tr>
                                  <th> Password </th>
                                  <td> <input type="Password"name="password" size="30"></td>
                             </tr>
                             <tr>
                                  <th><input type="submit" VALUE="Submit Data" onClick="return checkForm(this.form);"></th>
                                  <th></th>
                             </tr>
                             <tr>
                                  <th><input type="reset" VALUE="Reset Form"></th>
                                  <th></th>
                             </tr>           
                             </table>
                   </form>
    </body>
    </html>

  • Use netui tags within javascript function

    Is there anyway to use netui tags within a javascript function? I am trying to create a onChange event handler for a netui:select tag that will call a javascript function which will execute a few netui callMethod tags. The problem is that if the netui tags are embedded within a javascript function they are not translated into javascript. Is there some kind of function that I can wrap the embedded netui tags with so that they will be translated into javascript at runtime? Thanks.

    Hi,
    I am trying to embed JSP code within javascript
    t function, so that it can be called when the user
    leaves the page. No,you can't.
    JSP files are complied on server side while the javascript is the clint side code.
    if you really want to call the functio when the user leaves the page, you can call a function runs on the server side to set the session.
    regards

  • Problem saving Reader extended PDF created in Livecycle with Javascript functions built in

    Afternoon
    I have created an interactive PDF in Livecycle with built in Javascript functionality.  I need users to be able to complete and save the PDF so have saved it as a Reader extended PDF.  The problem I'm having is that when a user completes the form,saves it, and then opens it again the Javascript functionality is not showing despite showing the original selection that the user has made.  The Javascript is simply a dropdown menu that will show a different table based on the selection so isn't anything major.
    I've trawled forums and this is driving me mad so I'd appreciate some help.
    I am using Adobe Pro XI.
    Thanks in advance
    Ben

    At the moment I can't sorry.  I've run the Javascript debugger in Adobe Pro and it seems there are some errors
    Acrobat EScript Built-in Functions Version 11.0
    Acrobat SOAP 11.0
    ReferenceError: Table is not defined
    1:XFA:form1[0]:TextFieldContainer[0]:#subform[3]:#area[1]:Button1[0]:initialize
    ReferenceError: Table is not defined
    1:XFA:form1[0]:TextFieldContainer[0]:#area[2]:Button1[1]:initialize
    ReferenceError: Table is not defined
    1:XFA:form1[0]:TextFieldContainer[0]:#area[3]:Button1[2]:initialize
    ReferenceError: Table is not defined
    1:XFA:form1[0]:TextFieldContainer[0]:#area[4]:Button1[3]:initialize
    Basically the form has been built in Livecycle Designer and have drop down menus that show or hide tables depending on the selection but when I Reader Enable the form and users make a selection and then save the form it is not showing the table when it is opened again.
    I appreciate your help

  • Problem saving Reader extended PDF with Javascript functions built in

    Afternoon
    I have created an interactive PDF in Livecycle with built in Javascript functionality.  I need users to be able to complete and save the PDF so have saved it as a Reader extended PDF.  The problem I'm having is that when a user completes the form,saves it, and then opens it again the Javascript functionality is not showing despite showing the original selection that the user has made.  The Javascript is simply a dropdown menu that will show a different table based on the selection so isn't anything major.
    I've trawled forums and this is driving me mad so I'd appreciate some help.
    I am using Adobe Pro XI.
    Thanks in advance
    Ben

    http://forums.adobe.com/community/livecycle/livecycle_modules_and_development_tools/livecy cle_designer_es
    Karl Heinz Kremer
    PDF Acrobatics Without a Net
    PDF Software Development, Training and More...
    [email protected]
    http://www.khkonsulting.com

  • Accessing the FORM tag with Javascript.

    I ran into the following problem when writing the customization portion of a Java portlet.
    I have some JavaScript that I would like to have run when the customization form is submitted (ie, when the user clicks OK or APPLY).
    Normally, this is easy to do by specifying the 'onSubmit' event on the <FORM> tag. But I don't seem to have access to the FORM tag
    since it's being generated on the fly by Oracle Portal.
    So, how do I set up my code/portlet so that I can have some Javascript executed due to the onSubmit event?

    I may not be understanding the problem correctly so you may have already tried this:
    You should be able to dynamically adjust any form tag's attributes after the form's been generated, you just need to know how it's identified. If Portal isn't assigning it a consistant name you can use, you still might be able to adjust it. If you can place a piece of code "inside" the form, you could access the form tag with: "this.form.onSubmit = ..." That might be your best bet, but the "this" scope can be weird if I remember right. If you don't know that your code will always be inside the form tags, your other choice would be to write a function that will iterate over each form in the frameset and test for a input field name/value that you know is unique to your form. Then you'll be able to identify the form, and finally set the onSubmit value to whatever you want.
    Here's some pseudo javascript (I'm too lazy to go grab my reference guide to refresh my memory about the actual syntax you'd use) that might get you started:
    foreach form in parent.forms {
    if (form.foobar.value == "myUniqueValue") {
    var gotmyform = form;
    I think. :) It's been a while since I've done such a thing, but that's what I remember.
    I don't know squat about Portal (that's why I'm here poking at these forums), so I could be completely off base. If so, I'm sorry.
    Good luck,
    Sean
    null

  • Dynamic changes of option tags in a Select tag using JavaScript

    I got this problem during my project.
    I used Select tag in HTML code.
    I have to change options related to Select tag, based on events.
    How can we change options dynamically using JavaScript?
    Please post solution to this problem..

    You know Sun Java Studio Enterprise forum isn�t a right place for JavaScript & HTML questions.
    BTW here is you can find a lot of js stuff: docs, samples, tutorials, etc:
    http://www.w3schools.com/js/default.asp

  • Set multiple items with javascript function in chart link

    Hi Folks
    I am able to use the javascript $s function to set the value of one item from a chart link. I need to pass values to multiple items.
    Is there a way to use javascript function to pass values for multiple items on a page from a chart link
    Appreciate your responses
    Thanks
    Gopal

    Hi Arnau,
    You need to surround your JavaScript code like this (without the spaces before and after script):
    < script language="Javascript">
      window.open("<%=ABAP_VARIABLE%>").focus();
    </script >
    Regards,
    Patrick.

  • Help with javascript function

    I am getting a list of document urls from First Class by a
    loop, and I need to know how to save the identity of the one in the
    list that the user clicks on. I have tried many methods, but have
    nearly succeeded, if only I can solve the following problem. I have
    a javascript function called by the onclick method of <a
    href>, and I have used ToScript to pass the identity on to the
    next page. But I can't put the javascript variable into th
    ecoldfusion array. Here's the script:
    function getUrlNameFromLink(linkNumber){
    <cfoutput>
    var #toScript(XMLContent.rss.channel.item[3].link.xmlText,
    "jsURL")#;
    </cfoutput>
    alert(jsURL)
    This gives the correct link to the alert, if I hard-code the
    3 into the bracket. How do I use the linkNumber variable
    instead?

    well, using AJAX, and if your cf array is stored in a
    persistent scope
    (i.e. session), you could actually do it...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Update of a table from a select query with aggregate functions.

    Hello All,
    I have problem here:
    I have 2 tables A(a1, a2, a3, a4, a4....... ) and B( a1, a2, b1, b2, b3). I need to calculate the avg(a4-a3), Max(a4-a3) and Min(a4-a3) and insert it into table B. If the foreign keys a1, a2 already exist in table B, I need to do an update of the computed values into column b1, b2 and b3 respectively, for a1, a2.
    Q1. Is it possible to do this with a single query ? I would prefer not to join A with B because the table A is very large. Also columns b1, b2 and b3 are non-nullable.
    Q2. Also if a4 and a3 are timestamps what is the best way to find the average? A difference of timestamps yields INTERVAL DAY TO SECOND over which the avg function doesn't seem to work. The averages, max and min in my case would be less than a day and hence all I need is to get the data in the hh:mm:ss format.
    As of now I'm using :
    TO_CHAR(TO_DATE(ABS(MOD(TRUNC(AVG(extract(hour FROM (last_modified_date - created_date))*3600 +
    extract( minute FROM (last_modified_date - created_date))*60 +
    extract( second FROM (last_modified_date - created_date)))
    ),86400)),'sssss'),'hh24":"mi":"ss') AS avg_time,
    But this is very long drawn. Something more compact and efficient would be nice.
    Thanks in advance for your inputs.
    Edited by: 847764 on Mar 27, 2011 5:35 PM

    847764 wrote:
    Hi,
    Thanks everyone for such fast replies. Malakshinov's example worked fine for me as far as updating the table goes. As for the timestamp computations, I'm posting additional info: Sorry, I don't understand.
    If Malakshinov's example worked for updating the table, but you still have problems, does that mean you have to do something else besides update the table? If so, what?
    Oracle version : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Here are the table details :
    DESC Table A
    Name Null Type
    ID               NOT NULL NUMBER
    A1               NOT NULL VARCHAR2(4)
    A2               NOT NULL VARCHAR2(40)
    A3               NOT NULL VARCHAR2(40)
    CREATED_DATE NOT NULL TIMESTAMP(6)
    LAST_MODIFIED_DATE TIMESTAMP(6) DESCribing the tables can help clarify some things, but it's no substitute for posting CREATE TABLE and INSERT statements. With only a description of the table, nobody can re-create the problem or test their ideas. Please post CREATE TABLE and INSERT statements for both tables as they exist before the MERGE. If table b doen't contain any rows before the MERGE, then just say so, but you still need to post a CREATE TABLE statement for both tables, and INSERT statements for table a.
    The objective is to compute the response times : avg (LAST_MODIFIED_DATE - CREATED_DATE), max (LAST_MODIFIED_DATE - CREATED_DATE) and min (LAST_MODIFIED_DATE - CREATED_DATE) grouped by A1 and A2 and store it in table B under AVG_T, MAX_T and MIN_T. Since AVG_T, MAX_T and MIN_T are only used for reporting purposes we have kept it as Varchar (though I think keeping it as timestamp would make more sense). I think a NUMBER would make more sense (the number of minutes, for example), or perhaps an INTERVAL DAY TO SECOND. If you stored a NUMBER, it would be easy to compute averages.
    In table B the times are stored in the format : hh:mm:ss. We don't need milliseconds precision. If you don;'t need milliseconds, then you should use DATE instead of TIMESTAMP. The functions for manipulating DATEs are much better.
    Hence I was calculating is as follows:
    -- Avg Time
    TO_CHAR(TO_DATE(ABS(MOD(TRUNC(AVG(extract(hour FROM (last_modified_date - created_date))*3600 +
    extract( minute FROM (last_modified_date - created_date))*60 +
    extract( second FROM (last_modified_date - created_date)))
    ),86400)),'sssss'),'hh24":"mi":"ss') AS avg_time,
    --Max Time
    extract (hour FROM MAX(last_modified_date - created_date))||':'||extract (minute FROM MAX(last_modified_date - created_date))||':'||TRUNC(extract (second FROM MAX(last_modified_date - created_date))) AS max_time,
    --Min Time
    extract (hour FROM MIN(last_modified_date - created_date))||':'||extract (minute FROM MIN(last_modified_date - created_date))||':'||TRUNC(extract (second FROM MIN(last_modified_date - created_date))) AS min_timeIs this something that has to be done before or after the MERGE?
    Post the complete statement.
    Is this part of a query? Where's the SELECT keyword?
    Is this part of a DML operation? Where's the INSERT, or UPDATE, or MERGE keyword?
    What are the exact results you want from this? Explain how you get those results.
    Is the code above getting the right results? Are you just asking if there's a better way to get the same results?
    You have to explain things very carefully. None of the people who want to help you are familiar with your application, or your needs.
    I just noticed that my reply is horribly formatted - apologies! I'm just getting the hang of it.Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • PDF with javaScript function from Pro, not fully functional in Reader

    Hi,
    I followed recommendations to set up a button and apply a javaScript so that when end-user clicks on button, they can upload an image and then save the PDF.
    However, in Reader, the file extension drop-down is locked and forces end-user to only have the option of selecting a PDF as their image. I was going for JPG or GIF here at the very least.
    Is there anything else I could do, or am I stuck? In Pro, the drop down presents a wide array of file types in which to select from...
    Thank you!

    Adobe Reader can only insert PDF files as images. Adobe Reader can't convert other files.

  • Select Tag with XSL

    I have this xml and I will select with xsl only one of the "S�ugetier". How can I do this?
    <tier name="Hase" wildart="Haarwild">
    <systematik>
         <klasse wert="S�ugetier"/>
    </systematik>
    </tier>
    <tier name="Kanin" wildart="Haarwild">
    <systematik>
         <klasse wert="S�ugetier"/>     
    </systematik>
    </tier>

    You can use XSL-variables for the purpose of your task
    please consider my example - I have not tested it with your XML, but hope you can see the idea.
    <xsl:template match="/">
    <xsl:for-each select="//tier">
    <xsl:variable name="tier" select="."/>
    <xsl:for-each select="//klasse">
    <xsl:if test="@wert='S�ugetier'">
    ... you can use $tier here to access the current tier
    </xsl:if>
    </xsl:for-each>
    </xsl:for-each>
    </xsl:template>
    again, I have not tested it, just the idea is important,
    Stanimir Stanev

  • On iOS7.0.3 html select tag with attribute 'multiple' crashes Safari

    Try loading an HTML page on Safari that has:
    <div>Multi-Select Picklist- tap on this to crash the iOS app
    <select id="12121" title="Available" multiple="multiple" size="3" style="width: 120px;">
    <optgroup label="Available">
    <option value="1">AAAAAA</option>
    <option value="2">BBBBBB</option>
    <option value="3">CCCCCC</option>
    <option value="4">DDDDDD</option>
    </optgroup>
    </select>
    </div>
    Safari will crash once you tap on the picklist. If I remove the attribute 'multiple' or if you have set it as multiple="multiple" it will work, but then it will offcourse not allow multiple selection. At least need to know a workaround.

    You might be better of asking this in the Developer forum. They might know more information about that, or at least in the Safari forum. I'll ask the moderators to move this for you.

  • Database connection(select ,insert query) within javascript function

    Hi ,
    How to write the database connection(insert,delete or select query) within javascript function.Is it possible.Anyone can you help me
    than you

    Hi ,
    How to write the database connection(insert,delete
    ete or select query) within javascript function.Is it
    possible.No

  • Creating Select List with multiple columns

    I want to create a select list with multiple columns. I followed the demo application model described in the by Denes Kubicek (Currently my reference for APEX !!)
    The code is as follows:
    CREATE OR REPLACE FUNCTION getcrops(p_cropid IN NUMBER)
    RETURN VARCHAR2
    IS
    v_cropid VARCHAR2 (400);
    v_fcode VARCHAR2 (400);
    v_product VARCHAR2 (400);
    v_var VARCHAR2 (400);
    v_fname VARCHAR2 (400);
    v_acres VARCHAR2 (400);
    v_style_start VARCHAR2 (400);
    v_style_end VARCHAR2 (400);
    v_return VARCHAR2 (400);
    BEGIN
    FOR c IN (select "CROP"."CROPID" as "CROP ID",
         "CROP"."FIELDCODE" as "FIELD CODE",
         "CARROTPRODUCTLIST"."CARROTPRODUCTNAME" as "PRODUCT",
         "VARIETYLIST"."VARIETYNAME" as "VARIETY",
         "FIELD"."FIELDNAME" as "FIELD NAME",
         "CROP"."SIZEINACRES" as "ACRES"
    from     "FIELD" "FIELD",
         "CARROTPRODUCTLIST" "CARROTPRODUCTLIST",
         "VARIETYLIST" "VARIETYLIST",
         "CROP" "CROP"
    where "CROP"."CARROTPRODUCTTYPE"="CARROTPRODUCTLIST"."CARROTPRODUCTID"
    and     "CROP"."VARIETYID"="VARIETYLIST"."VARIETYLISTID"
    and     "CROP"."FIELDID"="FIELD"."FIELDID")
    LOOP
    v_cropid := TO_CHAR (c.'CROP ID', 'FML999G999G999G999G990');
    v_fcode := c.'FIELD CODE';
    v_product := c.'PRODUCT';
    v_var := c.'VARIETY';
    v_fname :=c.'FIELD NAME';
    v_acres :=c.'ACRES';
    FOR i IN 1 .. 12 - LENGTH (c."CROP ID")
    LOOP
    v_cropid := v_cropid || ' ';
    END LOOP;
    FOR i IN 1 .. 12 - LENGTH (c.'FIELD CODE')
    LOOP
    v_fcode := v_fcode || ' ';
    END LOOP;
    FOR i IN 1 .. 12 - LENGTH (c.'PRODUCT')
    LOOP
    v_product := v_product || ' ';
    END LOOP;
    FOR i IN 1 .. 12 - LENGTH (c.'VARIETY')
    LOOP
    v_var := v_var || ' ';
    END LOOP;
    FOR i IN 1 .. 12 - LENGTH (c.'FIELD NAME')
    LOOP
    v_fname := v_fname || ' ';
    END LOOP;
    FOR i IN 1 .. 12 - LENGTH (c.'ACRES')
    LOOP
    v_acres := v_acres || ' ';
    END LOOP;
    v_return := v_cropid || v_fcode || v_product || v_var || v_fname || v_acres;
    END LOOP;
    RETURN v_return;
    END;
    I created this anonymous Pl/SQL function at a application level ..Then I followed up to create a select list with a function inside. However I could not create select list with the command suggested in the demo which is
    select getcrops(cropid) d, cropid r from crop;
    APEX (2.1) returns a error message. What am I missing ? Should the function be called from somewhere else after creating a regular select list..? Where the functions (Pl/SQL) should be ideally stored for application level access..? and for across application level access ? How can I check the function works good. Help is appreciated.

    Still really one column.
    If they need to be independent then you've got to have three selection lists.
    %

Maybe you are looking for

  • How to display rounding value in sales order

    hi  i maintained each and everthing functionality in pricing procedure but it is not showing value of condition type DIFF while creating sales order so can explain this

  • Asynchronous web service call from Redwood

    Hi Everyone, Build version M33.104. We have a scenario where we have to call an asynchronous web service. From the documentation i understand that the Redwood job will be in status Running until the web service completes. How does the call back work

  • Delete data in database

    <% Connection conn = null; String nama = request.getParameter("nama"); String driver ="com.mysql.jdbc.Driver"; try{ Class.forName(driver);      conn = DriverManager.getConnection("jdbc:mysql://localhost/e-jualan", "root","123");      catch( Exception

  • Not able to activate my recent purchase of Production Studio Premium

    NFFDLL this topic is already discussed in the original post.  Please see the following: If the software title you have purchased is affected by the activation server being shut down, but is not available for download in the previously referenced page

  • How to install Tiger in the MacBook Aluminium?

    Tiger is NOT letting me install it on my new MacBook... any idea on how to hack it? Dino Message was edited by: strausz