Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    multiple form submission

    Hi I have a jsp file containing two different forms(means two drop down) with two javascript function and default value for both drop down is
    SELECT.
    expected functionality-is when I select from region form ,facility form should have only "select" and as soon as select value from region, facility value should be shifted to select
    present functionality-if i select value from region drop down ,facility value also changes from select.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ page errorPage="error.jsp" %>
    <html:html>
    <HEAD>
    <%@ page
    language="java"
    contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    %>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM WebSphere Studio">
    <META http-equiv="Content-Style-Type" content="text/css">
    <LINK href="../theme/Master.css" rel="stylesheet"
    type="text/css">
    <TITLE></TITLE>

    <script language="javascript">
    function submitRegion()
    {

    var ind = document.regionForm.region.selectedIndex;

    if ( ind == 0)
    {
    alert('Please select the required region ..');
    return;
    }
    else
    {
    document.regionForm.submit();
    }
    }
    </script>

    <script language="javascript">
    function submitFacility()
    {

    var ind = document.facilityForm.facility.selectedIndex;

    if ( ind == 0)
    {
    alert('Please select the required facility ..');
    return;
    }
    else
    {
    document.facilityForm.submit();
    }
    }
    </script>



    </HEAD>

    <BODY >
    <div class="menu" id="menubar">
    <!--
    <%String name = (String) request.getAttribute("name");
    //out.write(name);
    %>
    -->

    <html:link action="/nation">National Audit Report</html:link>
    <br></br>

    <h1 style="font-size:12px">Regional Audit Report</h1>
    <!-- <html:link action="/regionalauditreports">Regional Audit Report</html:link>
    <<br></br>-->
    <html:form action="/regionalauditreports">
    Region: <html:select style="width:95px;" property="region" name="regionForm" size="1" onchange="submitRegion()">
    <htmlption value="0">SELECT</htmlption>
    <htmlptions property="regionList" name="regionForm" />
    </html:select>
    </html:form>
    <br></br>
    <h1 style="font-size:12px">IATA Audit Report</h1>
    <!--<html:link action="/iata">IATA Audit Report</html:link>
    <br></br>-->

    <html:form action="/iata">
    Facility: <html:select property="facility" name="facilityForm" size="1" onchange="submitFacility()">
    <htmlption value="0">SELECT</htmlption>
    <htmlptions property="facilityList" name="facilityForm" />
    </html:select>
    <br></br>
    </html:form>

    <br></br>
    <html:link page="/help.jsp">Help</html:link>



    </div>

    </BODY>
    </html:html>

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Do not crosspost. It's against our Rules and will get your thread closed, like so.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •