Form Tag Issue

Hi!
am facing problem while submitting form through DropDown using onChange event!
Here i have two form tags and two drop down .in first form tag contain one drop down and
Second form tag contain another Drop down ..
when i change first drop down it redirects to the page properly, and i chose another drop down it redirect the page which is specified in first form tag,it is not redirect to the page which is specified in second form tag..
pls give me your suggestion regarding my issue...
<%
try{
Connection con,con1;
    Statement st,st1;
    ResultSet rs,rs1,rs2;
    ResultSetMetaData rsm,rsm1;
    List data=new ArrayList();
    List data1=new ArrayList();
    Iterator itr,itr1;
    String val,val1;
    int i=0;
    String dep[]=new String[100];
    int deplen;
    String dsn="jdbc:odbc:project";
            Class.forName("oracle.jdbc.driver.OracleDriver");
            con=DriverManager.getConnection(dsn,"module7","module7");
            st=con.createStatement();
            rs=st.executeQuery("select collname from college");
                        while(rs.next())
                            data.add(rs.getString(1));
                            i++;
           // rs1=st.executeQuery("select subcode from subject where sem not in '"+session.getAttribute("sem")+"' and dep='"+session.getAttribute("dep")+"' and sem1='"+session.getAttribute("mon1")+"' and currorarrear='Arrear'  order by subcode");
%>
    <form  name="f1" action="Coll" method="POST" >
        <table align="center" border="0">
                <tr>
                    <td>Select the College</td>
                    <td>
                        <select  class="red"  name="coll" id="s11" onchange="this.form.submit();">
                        <option value="Select">--------Select--------</option>
                            <%
                            try{
                        for(itr=data.iterator();itr.hasNext();)
                        val=itr.next().toString();
                            //out.print("111");
                        %>
                        <option value="<%=val%>"><%=val%></option>
                        <%}%>
                </select></td>
                </tr>
                   </form><%}catch(Exception e){}%>
                <form name="f2" action="CollDep" method="POST">
<%try{
    data1=(ArrayList)session.getAttribute("dep");
    if(session.getAttribute("dep").toString()!=null)
    {%>
               <tr>
                    <td>Select the Department</td>
                    <td><select name="univ" id="arr1" onchange="this.form.submit();">
                       <option>Department</option>
                       <%
                        for(itr=data1.iterator();itr.hasNext();)
                        val=itr.next().toString();
                      %>
                             <option value=<%=val%>><%=val%></option>
                        <%}%>
</select></td>
                </tr></form><%}}catch(Exception e){}%>
        </table>
        <center><input type="submit" value="Submit" name="b1" onclick="" /></center>
<%
}catch(Exception e){out.println(e);}
%>
           

The [HTML specification|http://www.w3.org/TR/html401/] forbids you to nest <form> elements.
That said, writing raw Java code in a JSP file is a bad practice. It makes it hard to read as well. Keep business/data logic in Java classes (servlets, DAO's, beans) and use taglibs/EL only in JSP.

Similar Messages

  • Form tag height cont.

    Can anyone please tell me why these two pages are being
    rendered so differently in IE than in FF and Safari?? The issue is
    the search box form tag on the right side of the dark teal nav bar
    in the header area. If I take that out, the spacing is fine in all
    three browsers. When I put IN the form tag, despite fussing with
    alignment and such, it pushes that table row too high only in IE.
    It's still fine in Safari and Firefox.
    Spacing is fine on this one without the search box:
    http://www.energeticnutrition.com/contact-testlvh2-2.html
    Spacing is too tall on the teal bar in this one with the
    search box, only in IE.
    http://www.energeticnutrition.com/contact-testlvh2-2.html
    Any help...please??? :-)
    Thanks!

    Lvanhoff wrote:
    > Still not working...any ideas anyone?
    >
    >
    http://www.energeticnutrition.com/contact2.html
    >
    > In FIrefox the alignment of the search box is perfect.
    In IE, it's over too
    > far to the left.
    >
    > I tried the agove fix but it didn't work...perhaps i
    didn't implement
    > correctly?
    >
    > I did:
    > <form action="/search/search.php" method="get"
    style="display: inline">
    > <input onfocus="this.value=''" type="text"
    name="query" id="query" size="35"
    > value="Search..."
    style="height:12px;font-size:12px;margin-top:0px;
    > margin-bottom:0px;margin-right:2px"><input
    type="hidden" name="search"
    > value="1"></form>
    >
    > and on the style sheet
    > }
    > #searchbox {
    > padding: 0;
    > margin: 0;
    > }
    >
    > Any other suggestions??
    I see you have it sorted now, but one thing you should also
    have done is
    to remove the style information from the query input field,
    as those
    styles will override any style you set in the styles I gave
    you. You
    also had the style display: inline on the form which I said
    to remove.
    You also didn't give the form an id. The above code looks
    like you
    didn't try any of my suggestions, but I am glad someone else
    found
    another solution for you.
    Dooza

  • It looks like your problem is at the beggining in the form tag, specificall

    Hello,
    I'm having an issue with a cgi form that I created (added on to a website I created using iWeb). Basically, here's the problem: I'm not sure if I have to FTP it over to mac in order for it to work, but if someone could let me know if that's the issue, I'd appreciate it. Basically, when any client hits the submit button on my site to fill out a quote request, it DOES NOT go into my inbox. Why?
    Here's the html code:
    http://yourdomain.com/cgi-bin/FormNewMail.cgi
    Below is a comment I received from someone who thought they knew where the problem was.
    "It looks like your problem is at the beginning in the form tag, specifically
    this part:
    action="http://yourdomain.com/cgi-bin/FormNewMail.cgi"
    When I type in that address, the correct page isn't loading, which probably
    means you haven't uploaded the actual "FormNewMail" script to your cgi-bin
    folder (at Webintellects).
    Anyone care to tackle this one?
    Thx,
    J

    What exactly does iWeb support as far as html forms then?
    Search this forum for "form".
    http://discussions.apple.com/thread.jspa?messageID=7650084&#7650084

  • Firefox didn't show any response to AUTOCOMPLETE="off", I implment this code in form tag and even in input tag too, but no response

    Firefox didn't show any response to AUTOCOMPLETE="off", I try so many codes using jquery and html but no response, I implement this code in form tag as well as in input tag, in my registration form when ever the cursor focus on the username field already saved username display, pls let me help me to solved this issue.
    Thanks.
    Saravanaraj
    [email protected]

    If autocomplete data already previously has been saved in Firefox then adding autocomplete=off won't have effect since this data is already stored and you need to remove this manually via (Shift+) Delete.
    If you are experimenting with code then you need to take this into account and possibly use forget about this site.
    Using "Forget About This Site" will remove all data stored in Firefox from that domain like bookmarks, cookies, passwords, cache, history, and exceptions, so be cautious and if you have a password or other data from that domain that you do not want to lose then make sure to backup this data or make a note.

  • How does Validated Form tag insert the error message?

    I'm using validated forms tags in my jsp and when there is an error in the form
    the error message is set to display on top of the wrong field. This is an attribute
    that I set in the <portlet:validatedForm> tag called "messageAlign", but I want
    to know how this is inserted or what I can do to line it up above the text field
    because it is moving all the elemnts around in the table cell. Any insight would
    be helpful.
    Thanks,
    Travis

    Hard to know what the cause is  because it's like this
    I know what I did to cause this. I upgraded my one of my hard drives, renamed the drive and moved the folder. The missing pictures it can't find were added with the option in the advance menu "copy photo to library" turned off.
    and this
    What I did is added a small SSD as my primary drive. Put the OS and all the apps on it.  Moved my iPhoto and iTunes libraries to an large external.  Most of the picture it is not having a problem wth.  Only certain ones.  Don't actually think I unchecked tha prefeence, but it's acting like i have.  
    seem to be written by two different people.
    This thread
    https://discussions.apple.com/thread/3216539?tstart=30
    has details on how one user hacked the SQL database to fix the issue. Not for the faint hearted. Back up first.
    Regards
    TD

  • Question about creating Custom JSF form tag and renderer

    Is it possible to build a custom form tag in JSF and have it replace the standard jsf form tag. Are there any potential issues with child forms or anything else.
    I created the following
    - custom form component class that extends javax.faces.component.UIForm (the only changes I made was to change the value of the COMPONENT_TYPE attribute and change the value for renderer type)
    - custom form renderer class that extends HtmlBasicRenderer and I made changes to the encodebegin method and encrypt the value of the id and action url)
    - custom form tag class that extends UIComponentELTag ( I did not make any changes here)
    - tld for my custom form tag
    - created an entry in faces-config.xml of my web-app for my custom form tag
    Are there any issues with the above.
    Is there something I should do in addition.

    In theory you should be fine. Some of the open source libraries either swap out the renderer for the standard h:form component or supply their own form components. You could look at their code for reference if need be.

  • How do I use dynamic JSP vars in a form tag with implicit sessions?

    I'm using iAS 6 SP4 and 'lite' sessions w/ sticky LB on Win2K for development and need to use a dynamic variable (via an = scriptlet) to specify the URL a form tag's ACTION method posts to. The implicit URL session encoding attempts to add the hidden input tags to the form but part of it is getting cut off. If I remove the dynamic var scriptlet from the form tag it works fine. How can I use dynamic vars and implicit URL session encoding?
    Here's my code sample:
    <FORM NAME='Create' METHOD='POST' ACTION='<%= servletRootStr %>CreateServlet' TARGET='_top'>
    Output is:
    <FORM NAME='Create' METHOD='POST' ACTION='http://my.server.com/NASApp/WebStuffApp/Create' TARGET='_top'>T NAME="GXHC_gx_session_id_" TYPE="HIDDEN" VALUE="GXLiteSessionID--8351372849698357580" ></INPUT><INPUT NAME="GXHC_GX_jst" TYPE="HIDDEN" VALUE="d692bc3d662d6164" ></INPUT>
    Because the <INPUT> tagon the first session var is cut off, up to the T, the page obviously fails. Can this be fixed with a config setting, or is it a bug in iPlanet??

    Thanks for helping me Anurag.
    The problem I tried to solve was that I want the result from my service methods
    in XML format. I thought a callback/polling was the best alternative, am I right?
    Since the callback option doesn´t work I will try to poll the service.
    Are there any other options for solving my problem??
    Thanks again!!
    /A
    "Anurag Pareek" <[email protected]> wrote:
    >
    Andrej,
    I guess you are trying to invoke a Webservice which defines a callback
    method
    from a JSP, and want the JSP to handle the callback made by the webservice.
    For a client to be able to handle a callback made by a Webservice, it
    has to be
    a web service in itself.
    Even some web service tools do not support 'Solicit responses' and hence
    they
    would not generate handlers for the callback methods by default. You
    can download
    a callback WSDL in such cases and implement it on the client side. The
    server
    side web service will then callback to that webservice.
    The other option to callbacks is to use polling methods. This can be
    done from
    any client such as Java client/ JSP client or a .NET client.
    Hope this helps. Let me know if you have any further questions.
    Regards,
    Anurag
    "Andrej" <[email protected]> wrote:
    I´ve tried this but with no success..
    How do I recieve the data in a servlet/JSP-page?
    Thanks.

  • Help needed with Myfaces - tomahawk t:panelTabbedPane form tag iserted wh

    when i Use tomahawk <t:panelTabbedPane> component, during rendering stage. its atomatically inserts <form> tag around it.
    Is there any way to avoid this <form tag. because, I am using 3 tab column, and each tab has got its own form tag.
    so in that case. there is <form> inside <form>, thats giving errors when using some javascript function with this..
    is there any solution for this

    Hi,
    Could you please tell us if you are using Sun Java Studio Creator for building your web application.
    RK

  • How to use Direct Access URL in the FORM tag

    I want to substitute the pageid url (/servlet/page?_pageid=161&_dad=portal30&_schema=PORTAL30) with the direct access urls (pls/portal30/url/page/my_page) to address the pageid conflict between development server and production server.
    It works perfectly fine in the redirection code such as:
    self.location.href="/pls/portal30/url/page/next_page". But I got "Page can not be found" error message when I use it in the <FORM> tag:
    <FORM ACTION="/pls/portal30/url/page/next_page" METHOD="POST" NAME="my_form">
    Does anyone out there know how to use the direct access url inside the <FORM> tag? I am trying not to write a bunch of code just to retrieve and insert the pageid at the run time.
    Thanks in advance.
    Arthur

    Use condition. If you are validating a record, just out the desired check in the condition field for that specific item.
    Thanks
    Nagamohan

  • Control 'ctl00_SPWebPartManager1_g_d4fb972b_26ec_4065_9c89_80b51b384492_gvwikireport' of type 'GridView' must be placed inside a form tag with runat=server.

    Hi,
    I have written code for 'Export To Excel' in the visual web part as below
    //ascx file    
    <table>
        <tr>
            <td>From Date:</td>
            <td><SharePoint:DateTimeControl ID="dtFromDate" runat="server" DateOnly="True" /></td>
        </tr>
        <tr>
            <td>To Date:</td>
            <td><SharePoint:DateTimeControl ID="dtToDate" runat="server" DateOnly="True" TimeOnly="False" /></td>
        </tr>
        <tr>
          <td>Report Type:<asp:DropDownList ID="ddlreporttype" runat="server"><asp:ListItem>Consolidated</asp:ListItem><asp:ListItem>Question Wise</asp:ListItem></asp:DropDownList></td>
            <td>
                <br />               
                <asp:GridView ID="gvwikireport" runat="server">
                </asp:GridView>                   
            </td>
        </tr>   
        <tr>
            <td><asp:Button ID="btnExportToExcel" runat="server" Text="Export To Excel" OnClick="btnExportToExcel_Click"/></td>
        </tr>  
        </table>
    //cs file
    protected void Page_Load(object sender, EventArgs e)
                if (!Page.IsPostBack)
                    BindGridview();
    private void BindGridview()
                DataTable dt = new DataTable();
                dt.Columns.Add("UserId", typeof(Int32));
                dt.Columns.Add("UserName", typeof(string));
                dt.Columns.Add("Education", typeof(string));
                dt.Columns.Add("Location", typeof(string));            
                dt.Rows.Add(1, "SureshDasari", "B.Tech", "Chennai");
                dt.Rows.Add(2, "MadhavSai", "MBA", "Nagpur");
                dt.Rows.Add(3, "MaheshDasari", "B.Tech", "Nuzividu");
                dt.Rows.Add(4, "Rohini", "MSC", "Chennai");
                dt.Rows.Add(5, "Mahendra", "CA", "Guntur");
                dt.Rows.Add(6, "Honey", "B.Tech", "Nagpur");
                gvwikireport.DataSource = dt;
                gvwikireport.DataBind();
    protected void btnExportToExcel_Click(object sender, EventArgs e)
                Page.Response.ClearContent();
                Page.Response.Buffer = true;
                Page.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "WikiReport.xls"));
                Page.Response.ContentType = "application/ms-excel";
                StringWriter sw = new StringWriter();
                HtmlTextWriter htw = new HtmlTextWriter(sw);
                gvwikireport.AllowPaging = false;
                BindGridview();
                //Change the Header Row back to white color
                gvwikireport.HeaderRow.Style.Add("background-color", "#FFFFFF");
                //Applying stlye to gridview header cells
                for (int i = 0; i < gvwikireport.HeaderRow.Cells.Count; i++)
                    gvwikireport.HeaderRow.Cells[i].Style.Add("background-color", "#df5015");
                gvwikireport.RenderControl(htw);
                Page.Response.Write(sw.ToString());
                Page.Response.End();            
    But after clicking the 'Export To Excel' button i am getting the below error
    Control 'ctl00_SPWebPartManager1_g_d4fb972b_26ec_4065_9c89_80b51b384492_gvwikireport' of type 'GridView' must be placed inside a form tag with runat=server.
    In case if i am modifying the code as below I am getting error as 'page can have only one server tag'.
    <form id="frmgrdview" runat="server">
     <asp:GridView ID="gvwikireport" runat="server">
                 </asp:GridView></form>
    So please share your ideas/thoughts on the same.
    Regards,
    Sudheer 
    Thanks & Regards, Sudheer

    Hi,
    According to your post, my understanding is that you fail to export to excel.
    I create a demo as below, it works well.
    <table>
    <tr>
    <td>
    <asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
    </td>
    <td>
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>
    <asp:GridView ID="gvwikireport" runat="server">
    </asp:GridView>
    </td>
    <td>
    <br />
    <asp:Button ID="btnExportToExcel" runat="server"
    onclick="btnExportToExcel_Click" Text="Export to excel" />
    </td>
    </tr>
    </table>
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Data;
    using System.IO;
    namespace Export_to_Excel.VisualWebPart1
    public partial class VisualWebPart1UserControl : UserControl
    protected void Page_Load(object sender, EventArgs e)
    if (!Page.IsPostBack)
    BindGridview();
    private void BindGridview()
    DataTable dt = new DataTable();
    dt.Columns.Add("UserId", typeof(Int32));
    dt.Columns.Add("UserName", typeof(string));
    dt.Columns.Add("Education", typeof(string));
    dt.Columns.Add("Location", typeof(string));
    dt.Rows.Add(1, "SureshDasari", "B.Tech", "Chennai");
    dt.Rows.Add(2, "MadhavSai", "MBA", "Nagpur");
    dt.Rows.Add(3, "MaheshDasari", "B.Tech", "Nuzividu");
    dt.Rows.Add(4, "Rohini", "MSC", "Chennai");
    dt.Rows.Add(5, "Mahendra", "CA", "Guntur");
    dt.Rows.Add(6, "Honey", "B.Tech", "Nagpur");
    gvwikireport.DataSource = dt;
    gvwikireport.DataBind();
    protected void btnExportToExcel_Click(object sender, EventArgs e)
    Page.Response.ClearContent();
    Page.Response.Buffer = true;
    Page.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "WikiReport.xls"));
    Page.Response.ContentType = "application/Excel";
    StringWriter sw = new StringWriter();
    HtmlTextWriter htw = new HtmlTextWriter(sw);
    gvwikireport.AllowPaging = false;
    BindGridview();
    //Change the Header Row back to white color
    gvwikireport.HeaderRow.Style.Add("background-color", "#FFFFFF");
    //Applying stlye to gridview header cells
    for (int i = 0; i < gvwikireport.HeaderRow.Cells.Count; i++)
    gvwikireport.HeaderRow.Cells[i].Style.Add("background-color", "#df5015");
    gvwikireport.RenderControl(htw);
    Page.Response.Write(sw.ToString());
    Page.Response.End();
    The result is as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Is there a workaround for inserting form tags?

    Long time ago some developers found some bugs in the SWING class. The bug seems to appear when an HTML page pasted in the browser. Then the <form>-tags are disappeared while they can be found before pasting the HTML into the browser.
    This is my code so far:
    int pos = 0;
    int i = 0;
    body = getBodyContent();
    JspWriter out = body.getEnclosingWriter();
    HTMLKit = new HTMLEditorKit();
    try {
    out.println(body.getString());
    body.clearBody();
    String theQuery = "http://documentum1.europe.intranet/Docu2store:/list.htm?objectID=" + folderid + "&framed=yes|0&docstart=" + docstart;
    try {
    URL aURL = new URL( theQuery );
    URLConnection conn = aURL.openConnection();
    JEditorPane HTMLPane = new JEditorPane();
    HTMLPane.setContentType("text/html");
    HTMLPane.setPage(aURL);
    HTMLPane.read( new InputStreamReader( conn.getInputStream() ), "Docu2store" );
    //HTMLPane.read( new Reader (conn.getInputStream() ), "Docu2Store" );
    HTMLDoc = (HTMLDocument) HTMLPane.getDocument();
    //HTMLDoc.setBase(new URL ("http://documentum1.europe.intranet/"));
    // Reading the form
    HTMLDocument.Iterator form = HTMLDoc.getIterator(HTML.Tag.FORM);
    //form.next();
    Enumeration formEnum = form.getAttributes().getAttributeNames();
    out.println (form.getAttributes().getAttributeNames());
    out.println (form.getAttributes().getAttribute(formEnum.nextElement()).toString());
    //form.next();
    //out.println (form.getAttributes().getAttribute(formEnum.nextElement()).toString());
    // Reading the links and replace them
    HTMLDocument.Iterator theLinks = HTMLDoc.getIterator(HTML.Tag.A);
    theLinks.next();
    while (theLinks.isValid()) {
    Enumeration theAttsEnum = theLinks.getAttributes().getAttributeNames();
    String theValue = theLinks.getAttributes().getAttribute(theAttsEnum.nextElement()).toString();
    if (theValue.indexOf("sorting", 0) > 0) {
    i++;
    int pageNum = giveItemUrl("docstart", theValue) + 1;
    int startPosLink = theLinks.getStartOffset();
    int endPosLink = theLinks.getEndOffset();
    int linkLength = endPosLink - startPosLink;
    try {
    HTMLDoc.remove(startPosLink, linkLength);
    String fid = giveItemUrlString("objectID", theValue);
    String docstart = giveItemUrlString("docstart", theValue);
    String sorting = giveItemUrlString("sortingfield", theValue);
    HTMLKit.insertHTML(HTMLDoc, endPosLink - 1, "<a href='main.jsp?fid=" + fid + "&docstart="+docstart+"'>" + Integer.toString(pageNum) + "</a>", 0, 0, HTML.Tag.A);
    } catch (BadLocationException ble) {
    ble.printStackTrace();
    out.println( i + "fout" );
    theLinks.next();
    HTMLPane.write(out);

    Insert HTML via InsertHTML() doesn't work! After writing the HTMLDocument, Java inserts extra <html> tags!

  • More than one h:form tag?

    Hi, I have my pages setup with a header and footer page. So that each page does this:
    home.jsp:
    <%@ include file="/includes/header.jsp" %>
    <%@ include file="/includes/footer.jsp" %>Now, both the header.jsp and footer.jsp pages use h:commandLink tags wrapped inside h:form tags. Like:
    <h:form>
        <h:commandLink id="myLink" action="myLink" title="#{resources.myLabel}" >
            <h:outputText value="#{resources.myLabel}" />
        </h:commandLink>
    </h:form>The problem is that only the ones defined in the header page work. If I remove the h:form and all h:commandLink tags from the header page then the ones in the footer page work. Seems like if you setup your pages like this that only the first h:form block works. Whats the deal with that? Not sure if its because I'm mixing JSP with JSF and if there are problems with that but seems like making a header and footer page included on all pages is a legitimate approach, am I missing something?
    Thanks for any help,
    Mike

    After looking at my JavaScript console, I get the following JavaScript error when I click on a link in the second form:
    Error: document.forms['Header:two']['Header:two:_idcl'] has no properties
    I looked this bug up in the Bug Database and found it (5055795). It says its fixed, but unfortunately doesn't say what version its fixed in or where/when the fix is available. Does anybody have any clue where/when this fix will be available?
    Thanks.

  • h:commandLink requires form tag

    Hi,
    I do not know where to find an answer. If you could help me with that, I would be very grateful to you as I have encountered this problem many times.
    The jsf programs that have h:commandLink in it works fine as an individual component. In reality, we develop application with a left hand side for menu and the right hand side for content display. We have a index.jsp (main) page with all the and <h:form> tags. Based on the menu selected, the content page will be displayed. The content page will have only the tags for content display and not the and <h:form> tags.
    If the content page has a h:commandLink, it expects a <h:form> tag around it. If we include <h:form> tag in the content page, then it becomes a nested form as the index.jsp has already a <h:form> tag and the content page does not work as expected.
    I am unaware of how to handle this situation if we have a h:commandLink/h:commandButton tag in the content page .. and the index.jsp has already 'form' tag in it.
    I get the error message next to h:commandLink stating "This tag must be nested within
    tag". Even though the main page has the form tag, this content page with the h:commandLink expects it. Not sure how to handle it.. Please suggest
    Can you please let me know..
    Thanks a lot
    Aish

    Hi,
    Yes. I get this error message on the IDE (I am using IBM RAD 7). As soon as I type the code, The ide displays the error message.
    As you have suggested, I ran my code ignoring the error and the commandlink worked fine.
    Thanks a lot for resolving my problem which has been for sometime.
    Aishu

  • Error in form tag which calls a javascript function

    Following is the code
    <script type="text/javascript">
    try{
         var variable3=(document.forms[0]).server_Name.value;
         var variable=(document.forms[0]).job_Name.value;
         }catch(err){}
      function returnall()
           var vald2=checkempty();       
           var vald3=checkspace();
           var vald1=checkemail(variable3);
           if(vald2 && vald3 && vald1)
                return true;
           return false;                  
       function checkemail(variable3)
          bcd = document.getElementById('EmailAd');
          var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
          if (!filter.test(bcd.value)&& bcd.value != '')
          document.getElementById('emailvalid').innerHTML = 'Please enter a valid email Address';
             return false;
        function checkempty()
              var abc, bcd, cde, def, efg, fgh, ghi
              abc = document.getElementById('jobn');
              bcd = document.getElementById('EmailAd');
              cde = document.getElementById('pass');
              if (abc.value == ''&& bcd.value == ''&& cde.value == '')
                   document.getElementById('nodata').innerHTML = 'Please enter jobname,Email and Password ';
             else
             if(bcd.value == ''&& cde.value == '')
                       document.getElementById('nodata').innerHTML = 'Email and Password cannot be left blank';
             else
             if(abc.value == '' && cde.value == '')
                       document.getElementById('nodata').innerHTML = 'Job name and Password cannot be left blank';
                else
                if(abc.value == ''&& bcd.value == '')
                     document.getElementById('nodata').innerHTML = 'Job name and Email cannot be left blank';     
                else
                if (abc.value == '')
                        document.getElementById('nodata').innerHTML = 'Job name cannot be left blank';
             else
                if (bcd.value == '')
                       document.getElementById('nodata').innerHTML = 'Email cannot be left blank';
             else
             if (cde.value == '')
                        document.getElementById('nodata').innerHTML = 'Password cannot be left blank';
                    return false;
         function checkspace()
            abc = document.getElementById('jobn');
           var filter=(/\s/g);
          if (!filter.test(abc.value))
              return false;
         else
          document.getElementById('checkspace').innerHTML = 'Please do not enter spaces in job name field';
           return true;
    </script>
    </head>
    <body bgcolor="#555555">
    <form name="myForm" action="/WorkProject/WebContent/index.jsp" method="post" onSubmit="return returnall();" >Though the pages runs fine..when i compile i get this error " Void function cannot return a value"in form tag above.. How can i solve this error? please help..

    Thanks a lot..I solved that problem..
    <script type="text/javascript">
    try{
         var variable3=(document.forms[0]).server_Name.value;
         var variable=(document.forms[0]).job_Name.value;
         }catch(err){}
      function  getAll()
           checkempty();       
           checkspace();
           checkemail(variable3);                        
       function checkemail(variable3)
          bcd = document.getElementById('EmailAd');
          var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
          if (!filter.test(bcd.value)&& bcd.value != '')
          document.getElementById('emailvalid').innerHTML = 'Please enter a valid email Address';
        function checkempty()
              var abc, bcd, cde, def, efg, fgh, ghi
              abc = document.getElementById('jobn');
              bcd = document.getElementById('EmailAd');
              cde = document.getElementById('pass');
              if (abc.value == ''&& bcd.value == ''&& cde.value == '')
                   document.getElementById('nodata').innerHTML = 'Please enter jobname,Email and Password ';
             else
             if(bcd.value == ''&& cde.value == '')
                       document.getElementById('nodata').innerHTML = 'Email and Password cannot be left blank';
             else
             if(abc.value == '' && cde.value == '')
                       document.getElementById('nodata').innerHTML = 'Job name and Password cannot be left blank';
                else
                if(abc.value == ''&& bcd.value == '')
                     document.getElementById('nodata').innerHTML = 'Job name and Email cannot be left blank';     
                else
                if (abc.value == '')
                        document.getElementById('nodata').innerHTML = 'Job name cannot be left blank';
             else
                if (bcd.value == '')
                       document.getElementById('nodata').innerHTML = 'Email cannot be left blank';
             else
             if (cde.value == '')
                        document.getElementById('nodata').innerHTML = 'Password cannot be left blank';
         function checkspace()
            abc = document.getElementById('jobn');
           var filter=(/\s/g);
          if (!filter.test(abc.value))
         else
          document.getElementById('checkspace').innerHTML = 'Please do not enter spaces in job name field';
    </script>I made the following changes in the code to call getAll method..
    <td><input type="button" value="Submit" name="Submit" action="/WorkProject/WebContent/index.jsp" method="post" onClick=" getAll();" >

  • Name attribute not giving the desired result in form tag

    Hi,
    I am using struts and the name attribute in form tag is not giving me the desired reuslt. The code is
    <html:form name="loginActionForm" type="source.form.LoginActionForm" action="/login.do" method="post">
    </html:form>
    when I am trying to use the name in javascript then I am getting an error
    "document.loginActionForm " is null or not an object.Where am I going wrong?

    I did so but the name I have used in the form tag is the same as what i have used in javascript.I dont think that it is a javascript error and it must be some mistake I made in the form tag.Also one more thing is it necessary to use the type attribute if you use the name attribute.

Maybe you are looking for

  • Can viewObject get a parameter from sessionScope to binding variable?

    hello, using Jdev11g ADF Fusion application Can viewObject get a parameter from sessionScope and assign into binding variable ? without using executeWithParameter Thanks greenApple

  • ACS 5.3 and Command Auth

    I am rolling out the Latest 5.3.0.40.6 patched ACS 1121 in a redundant pair mode.   I have build user based auth without issue but am having an issue with Command auth.  once I add command auth to the test router and modify the shell profile and comm

  • What's new in Java 4

    Anybody can quickly explain the things are added in Java 4 newly. Thnx in advance.

  • Ipod Mini's Hold Lock not working.

    Hi, My girlfriend's Ipod Mini appears to be stuck with the Hold Lock permanently on. The Ipod can not be turned on nor does it respond when it is hooked up to the computer. I have updated it's software but I am unable to reset it. Can you suggest any

  • Quicktime doesn't uninstall

    I accidentally uninstalled quicktime and I was trying to re-download it but i get errors and when i try to delete the older version it just doesn't delete. If there is any way to recover it to get my i tunes back as well, please let me know, Thank Yo