I want to post the values of the form in the same Jsp Page

I want to post the values of the form in the same Jsp page.

Was that a question? Or are you just informing the world of your grand intentions?
But yeah, all you need to do is direct your action to the same page you're in. So, if this is your foo.jsp, it'd be something like...
<%
if(request.getParameter("bar") != null) out.println("Hello");
%>
<form method="post" action="foo.jsp">
   <input type="text" name="bar" value="baz">
   <input type="submit">
</form>When you submitted your form, it would post the value to the same JSP page as you're already in, and print out Hello to the screen. "Hello" would not print out on the first visit, as the request would obviously not contain the parameter "bar" yet.

Similar Messages

  • I want to sent to values from a form to the sevlet

    Hello
    I have a html file with some like that:
    <form action="htpp://myservlet" method="post">
    <label>Select your favorites interests</label>
    <input type="checkbox" name="interests" value="Economy" />
    <input type="checkbox" name="interests" value="Sports" />
    <input type="checkbox" name="interests" value="Computers" />
    </form>
    In the servlet I've got:
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    String interest= request.getParameter("interests");
              if(interes!=null){
                   String[] interests= request.getParameterValues("interests");
                   String value ="";
                   for(int i=0;i<intereses.length;i++){
                        value += interests[i]+",";
         }     Well at the moment everything easy, I get my interest choosen, Economy, Sports, .... But What I want it's to get names (as now) and some id value as well.
    For example: Economy is 1, Sports is 2, Computers 3, and so forth. So I want to get from html the interest pick it but and number identicative for any option selected. If I choose Economy and Computers, this getParameterValues("interests"), I get Economy and Computers, but I would like to get 1 and 3 as well.
    I don't have really idea how to do this.
    Tranks in advance

    I think you want something like this:
    <input type="checkbox" name="interests" value="1" /> Economy
    <input type="checkbox" name="interests" value="2" /> Sports
    <input type="checkbox" name="interests" value="3" /> Computers

  • How to get the value from a database without submitting a jsp page

    I have a jsp which has a text box depending on the value entered I want to get the value from a database for other two fields with out submitting jsp page. I am using struts.
    Thanks For any assistance provided.

    Alright,here is an example for you for the first case.
    Present.jsp:
    ============
    <html:html>
    <head>
    <title><html:message key="page.title"/></title>
    </head>
    <body>
    <html:form action="ChangeEvent.do">
    <html:hidden property="method"/>
    <!-- Submitting the Form onKeyUp of EmpId field and trying to save the
         state of the Form in the scope of session -->
    Emp Id:<html:text property="empId" size="5"  onkeyup="if(true){this.form.elements[0].value='populateDetails';this.form.submit();}"/>
    Emp Name:<html:text property="empName" size="10" />
    Email Address:<html:text property="email" size="10" />
    <html:submit>Submit</html:submit>
    </html:form>
    </body>
    </html:html>struts-config.xml:
    ==================
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    <!-- Form bean which stores the properties of all the Form elements -->
    <form-beans>
    <form-bean name="employeeFormBean" type="org.apache.struts.action.DynaActionForm">
       <form-property name="empId" type="java.lang.String"/>
       <form-property name="empName" type="java.lang.String"/>
       <form-property name="email" type="java.lang.String" />   
    </form-bean>
    </form-bean>
    <action-mappings>
    <action path="/ChangeEvent" type="Test.GetChangeAction" name="employeeFormBean" scope="request" parameter="method"> 
    <!-- On successful call of DB the Page has to be forwarded to the same page again by
          uploading updated form bean values. -->
    <forward name="success" path="/Present.jsp"></forward>
    <forward name="failed" path="/error.jsp"></forward>
    </action>
    </action-mappings>
    </struts-config>GetChangeAction.java:
    =====================
    public class GetChangeAction extends DispatchAction{
      public ActionForward populateDetails(ActionMapping mapping,ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
            DynaActionForm dForm = (DynaActionForm)form;
            String empId = dForm.get("empId");     
            // calling Model / Db and then getting back Employee Details
            EmployeeBean eb = ModelUtils.getDetails(empId);
            // Updating form bean by updating values from the Model 
            dForm.set("empName".eb.getEmpName()); 
            dForm.set("email".eb.getEmail());
            return mapping.findForward("success");
    }well to me this should work regardless to any browser but we need to make sure we put in our logic properly.

  • Getting the values of a form (JSP, JavaScript involved)

    Hi, basically I want to read the values from one page to another one, but I have found that when call the jsp from a javascript function it does not work!!! ... if I call the page "getValues.jsp" directly from the <form action>, everything works perfectly ...
    ... does anyone know how to read the values without putting the jsp directly into the <form action>?
    In asp i used to get the values from the form with a "Request.Form('fieldName')" method, and i could call the asp from any javascript function. Does jsp has anything similar to that?
    ----- fillValues.jsp ----
    <script language="JavaScript">
    function doSomething(){
    // do something else
    window.document.location="getValues.jsp";
    </script>
    <html>
    <body>
    <form method="post" action="javascript:doSomething()" name="x">
    <input name="fldSubject" type="text">
    </form>
    </body>
    </html>
    ------- getValues.jsp ---
    <%@ page import="java.lang.*" %>
    <%@ page import="java.util.*" %>
    <jsp:useBean id="_mb" class="MyBean" scope="session"/>
    <%
    _mb.setSubject(request.getParameter("fldSubject"));
    %>
    <html>
    Subject <%= _pr.getSubject() %><br>
    </html>

    I dont know what the problem in your code is but the following works:
    <script>
    function foo()
    document.myForm.action="getValues.jsp";
    </script>
    <form name="myForm>
    <input type="submit" name="submit" onClick="foo()">
    </form>

  • How to get the values of Select-options from the screen.

    The value of parameter can be obtained by function module 'DYNP_VALUES_READ' but How to get the values of Select-options from the screen? I want the F4 help values of select-options B depending on the values in Select-option A.So I want to read the Select-option A's value.

    Hi,
    Refer this following code..this will solve your problem...
    "Following code reads value entered in s_po select options and willprovide search
    "help for s_item depending upon s_po value.
    REPORT TEST.
    TABLES : ekpo.
    DATA: BEGIN OF itab OCCURS 0,
    ebelp LIKE ekpo-ebelp,
    END OF itab.
    SELECT-OPTIONS   s_po FOR ekpo-ebeln.
    SELECT-OPTIONS s_item FOR ekpo-ebelp.
    INITIALIZATION.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_item-low.
      DATA:
      dyn_field TYPE dynpread,
      temp_fields TYPE TABLE OF dynpread,
      zlv_dynpro TYPE syst-repid.
      zlv_dynpro = syst-repid.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname     = zlv_dynpro
          dynumb     = syst-dynnr
          request    = 'A'
        TABLES
          dynpfields = temp_fields
        EXCEPTIONS
          OTHERS     = 0.
      LOOP AT temp_fields INTO dyn_field.
        IF dyn_field-fieldname EQ 'S_PO-LOW'.
            SELECT * INTO CORRESPONDING fields OF TABLE itab FROM ekpo
            WHERE ebeln EQ dyn_field-fieldvalue.
            EXIT.
        ENDIF.
      ENDLOOP.

  • How to fetch the value of tabular form item in javascript

    Hello all
    I want to do some calculations on the value entered by the user in the textfield of a tabular form, how can I fetch the value of tabular form item in the javascript?
    I am using normal tabular form, not using apex_item tabular form.
    I can pass the current textfield value to the function using "this" as a parameter, but how can I fetch the value of other rows of that same column?
    Thanks
    Tauceef

    Hi Alistair
    jQuery is still not working, but I got it done through some other means, this is the code:
    function total(pThis){
    var l_Row = html_CascadeUpTill(pThis,'TR');
    var l_Table = l_Row.parentNode;
    var l_Row_next = l_Row;
    var n_rows = l_Table.rows;
    var lInputs;
    var v1;
    var sum = 0.0;
    var temp;
    var i = 0;
    var j = 0;
    //alert(n_rows.length);
    while(j < (n_rows.length - 1))
    temp = 0;
    if(l_Row_next != null){
    lInputs = html_Return_Form_Items(l_Row_next,'TEXT');
    v1 = lInputs[0].value;
    //alert(v1);
    sum = parseFloat(sum) + parseFloat(v1);
    l_Row_next = l_Row_next.nextSibling;
    temp = 1;
    if(temp == 0){
    l_Row_next = l_Table.getElementsByTagName('TR')[1];
    lInputs = html_Return_Form_Items(l_Row_next,'TEXT');
    v1 = lInputs[0].value;
    sum = parseFloat(sum) + parseFloat(v1);
    l_Row_next = l_Row_next.nextSibling;
    j= j+1;
    $x('P78_TOTAL').value= parseFloat(sum);
    I am calling this function onblur event of the textfield.
    Still I am having one problem, I want to perform this calculation on load of the page also, how can I do that? because while calling onblur of the textfield I can pass that textfield to this function but on onLoad how I will pass the textfield to call this function so that I will be able to get the textfield value in the function?
    there may be some rows already existing, so I want the total of the existing rows to be displayed in my P78_TOTAL textfield that is why I need to do this calculation on onLoad of the page.
    Thanks
    Tauceef
    Edited by: Tauceef on Jul 8, 2010 4:57 AM

  • I am trying to pass the value of a field from the seeded page /oracle/apps/

    I am trying to pass the value of a field from the seeded page /oracle/apps/asn/opportunity/webui/OpptyDetPG. The value I want is in the VO oracle.apps.asn.opportunity.server.OpportunityDetailsVO and the field PartyName.
    I have created a button on the page whose destination URL is
    OA.jsp?OAFunc=XX_CS_SR_QUERY&CustName={#PartyName}
    It opens the correct page, but in the URL it shows this
    http://aa.com:8005/OA_HTML/OA.jsp?OAFunc=XX_CS_SR_QUERY&CustName=&_ti=1897289736&oapc=177&oas=x5E2TIfP1Y0FykBt1ek4ug..
    You can see that &CustName is not getting the proper value. Do I need to do something different?

    You cannot call the form with OA.jsp . This is applicable only for OAF based pages registered as a function.
    For calling a Form, use the below example:
    You have to change the application responsibility key and form function name .
    "form:PN:PN:STANDARD:XXPNTLEASE:QUERY_LEASE_ID={@QueryLeaseNumber}"
    Regards,
    Sudhakar Mani
    http://www.oraclearea51.com

  • Using Auto Suggest To Set The Value Of Multipe Form Fields

    I would like to use the Spry 1.5 Preview Auto Suggest widget
    to provide the value for multiple form fields based on the row the
    user selects in the auto suggestion data set. I've placed an
    example of what I want to do here:
    http://www.brucephillips.name/spry/Spry_P1_5_Preview/autosuggest/autosuggestMultipleFields .cfm
    It appears that when the user clicks on one of the rows in
    the auto suggestion data set, the current row for the data set is
    not updated but remains the default (first row in the data set).
    Therefore, if you have a spry:detailregion that uses that data set,
    the values for that detail region are from the first row in the
    data set and not the row the user selected.
    Is it possible to set the current row of the auto suggest
    data set to the row the user clicked on in the auto suggestion data
    set so that the spry:detailregion will have the values from the row
    the user clicked on?
    I had previously modified the Spry 1.4 Auto Suggest widget to
    do this. See:
    http://www.brucephillips.name/blog/index.cfm/2006/11/6/Modifing-Sprys-Auto-Suggest-Widget- to-Bind-Users-Selection-to-A-Form
    Thank you for any assistance.

    Cristian: thank you for the reply. I understand your concern
    about the user changing the auto suggest field after updating the
    complimentary fields. I think that could be handled through user
    instruction. Additionally, instead of using form fields to hold the
    complimentary data I could use non-editable paragraphs.
    I hope the change is not too difficult. I think this
    modification would make the auto suggest widget even more useful.
    For example think about a product auto suggest. User starts to type
    in the name of the product, selects the full product name from the
    auto suggestions, and now the page can immediately show in a
    spry:detailregion all the product details.
    Thanks again for considering my request. I really appreciate
    all the work the Spry team is doing. I'm looking forward to the
    official release of Spry.

  • How to pass the value to "Assignment" when submit the program RFITEMGL?

    Hello friends,
    I want to submit program RFITEMGL  (t-code FBL3N) with some screen fields, some fields are OK to fill such as u201COpen at key dateu201D, u201CG/L accountu201D and u201CCompany codeu201D。 But for the field "Assignment" (It will appear after cilck Dynamic Selection), I don't know how to pass value to it.
    Could you help me about how to pass the value to "Assignment" when submit the program RFITEMGL  (t-code FBL3N) ?
    Thanks a lot!

    Hi,
    Well you can create a small BDC.
    Regards,
    Harsh Bansal

  • Get the values from Day 1 of the Month

    Hi Friends,
    I have a requirement in which I have to Get the values from Day 1 of the Month.
    Ex : If I enter 19 - 07 - 2007.......the report should display Values from 01 - 07 - 2007.
    How to Code ?
    Please provide the Code.
    Thank you.

    Hello ,
              Check this code,
    DATA: test_datum1      LIKE sy-datum,
               test_datum2      LIKE sy-datum.
    WHEN 'TEST1'.
              IF i_step = 2.
          LOOP AT i_t_var_range INTO loc_var_range
            WHERE vnam = 'TEST2'.
            test_datum1      = loc_var_range-low.
        CONCATENATE test_datum1(6) '01' INTO  test_datum2.
        CLEAR l_s_range.
        l_s_range-low   = test_datum2.
        l_s_range-high  = test_datum1.
        l_s_range-sign = 'I'.
        l_s_range-opt  = 'BT'.
        APPEND l_s_range TO e_t_range.
    hope it helps,
    assign points if useful

  • How do I get the values from a form?

    How do I get the values from a form?

    You can try using request method..
    request.getParameter("yourFormInputName");
    Try this.

  • How can I obtain the value of a database column in a JSP variable ?

    How can I obtain the value of a table column in a JSP variable?
    For example the <jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>
    I need to have it in a variable like this:
    <% String cnt=<jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>; %>
    But it is not workig this way.
    Please help me to obtain the value.
    I am using JDev RC2.
    Thanks.

    Try something like
    String cnt = c1.getRowSet().getCurrentRow().getAttribute("Cont").toString();
    -A
    How can I obtain the value of a table column in a JSP variable?
    For example the <jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>
    I need to have it in a variable like this:
    <% String cnt=<jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>; %>
    But it is not workig this way.
    Please help me to obtain the value.
    I am using JDev RC2.
    Thanks.

  • How to retrieve the procedure value and pass the value to a form field

    How to retrieve the procedure value and pass the value to a form field?

    Set property for the field and the value is the actual procedure/function.
    Cheers

  • The value  is not allowed for the field Cross-plant CM

    Hello All
    When i copy material in refernce to existin gone. I am getting this message
    "The value  is not allowed for the field Cross-plant CM"
    I am not putting any thing in this Basic-view Cross-plant CM, but still getting this message.
    Any help will be good...Thanks in advance...

    Hi,
    Please check the check box in front of the field config material is checked?
    If so then this material is configurable material
    A material that can have different variants.
    For example, a car can have different paint, trim, and engines.
    Configurable materials have a super bill of material (BOM) that contains all the components for producing every variant of the material. Similarly, they have a super task list that contains all the operations. When a material is configured, only the components and operations needed for a variant are selected.
    Please check
    BR
    Diwakar

  • How to update the value in wbs element in the iw32

    Hi All,
    Can anyone help me in providing the USER EXIT OR BADI at the time of saving the IW31 / IW32  work order creation or Change. I need to populate the PSPEL ( WBS ELEMENT in Additional data tab with the value coming from Field Exit.
    Here is my analysis on the same.
    I have written Field Exit for Settlement Receiver field in Maintain Settlement SCREEN à 1 and Exporting the value.
    IMPORT the same value into Variable and need to pass the value to PSPEL field ( WBS ELEMENT ) in Additional Data Tab  using any USER EXIT or BADI at the time of save Work Order .
    I tried to use the USER EXIT u201CEXIT_SAPLCOIH_009u201D  and passed Manually at the time of Debugging into CAUFVD-PSPEL and executed. But the Value is not appearing in the Screen after execution.
    Any help is greatly appreciated.

    hi check this exit...
    IWO10012

Maybe you are looking for

  • AR Down payment Invoice US version 2005A

    I see many posts regarding down payment invoices, yet I do not see this feature in the US version. Does anyone know of a method to do a down payment in US version 2005A. We obtain large payment in advance and want to post this to a liability account

  • Where can I find software online for Canon Pixma mg5420 when my Mac OS 10.9.5 does not have CD slot?

    I am trying to scan articles and photos to email on my Mac.  I overlooked using the setup CD-ROM that came with the printer because my computer has no CD/DVD slot, but wonder if that is why the directions on the printer LCD screen don't tell me how t

  • Summary report from several forms

    Hi, Example: I am on a Plus/paid-plan and I work with five partners that all would like to collect the same data (name, email, address etc) from customers. Lets say John is a partner of mine, and I make a form for him, place the HTML code on a webpag

  • Unable to see integration of IDM in mozilla 4.0

    up to the 3.6 version of Firefox it shows the integration of IDM [Internet Download Manager] in the form of right click menu, after clicking right click it shows options like-download with IDM, download all files with IDM. But in Firefox 4.0 i unable

  • Oracle equivalent for temp table variable

    Can anyone help me regarding this.. sample code declare @temptable table (fldcaptioncode bigint, fldrownumber bigint identity (1,1)) i have declaration in sqlserver stored procedure, Is there any equivalent in oracle 10g Thanks in advance Regards Ari