hi,
im using tomcat and im trying to do simple submit form.
before submiting i must chek the fields.
the problem is that my submit functuin dosnt sends to the server the fields values.

help... how can i submit but check all the fields first???

here is my html

<%@ page language="java" import="java.util.*" %>
<%@ page import="com.event.manager.*" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
   

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>

<head>
  <title>Events</title>
      
<script language="javascript" type="text/javascript">
// <![CDATA[

    function checkform() {
     

            alert("Password1.value" + Password1.value);
            if (true) {
                document.frm.submit();
                
            }
            return true;
    

    } //Submit_onclick

// ]]>
</script>

</head>

<body>

<table
 style="width: 1000px; height: 268px; text-align: left; margin-left: auto; margin-right: auto;"
 border="0" cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td style="height: 145px; width: 283px;" colspan="3" border="0"  background="IMG\Heder.jpg" no-repeat></td>
    </tr>
    <tr>
      <td style="height: 145px; width: 60px;" border="0" background="IMG\Lbord.jpg"></td>
      <td
 style="height: 145px; background-color: rgb(199, 225, 227); width: 656px;" border="0">

 
     <table >
       <tr>
            <td >
                User ID</td>
            <td >
                <input name="TextUserID" type="text" /></td>
        </tr>
        
        <tr>
            <td >
                User Name</td>
            <td >
                <input name="TextUserName" type="text" /></td>
        </tr>
        <tr>
            <td >
                Password</td>
            <td >
                <input id="Password1" name="Password1" type="password" /></td>
        </tr>
        <tr>
            <td >
                Confirm Password</td>
            <td >
                <input id="Password2" name="Password2" type="password" /></td>
        </tr>
        <tr>
            <td >
                Full Name</td>
            <td >
                <input name="TextFullName" type="text" /></td>
        </tr>
        <tr>
            <td >
                Role</td>
            <td >
                <input name="TextRole" type="text" /></td>
        </tr>
        <tr>
            <td >
                &nbsp;</td>
            <td >
            <form name="frm"  action="/events/eventUsers" method="POST" >
               <input id="Submit" type="submit" value="submit SignIn" onclick="return checkform()" />
            		<input type="reset">
            	</form>
			 </td>
			
    </table>

 </td>
      <td style="height: 140px; width: 283px;  background-color: rgb(199, 225, 227);" background="IMG\RHeder.jpg" no-repeat></td>
    </tr>
    <tr>
      <td style="height: 39px; width: 283px;" border="0" colspan="3" background="IMG\BouttmBord.jpg" no-repeat>&nbsp;</td>
    </tr>
  </tbody>
</table>


</body>

</html>

Only form values are submitted when you press the submit button of the form. You need to place your form controls (text inputs, combo boxes, radio buttons) inside your form control for the values to be submitted to the server.

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.