Hi,

 The second servlet will not get any key values, and hence it is not
able to do a delete operation. You may have to have some hidden fields
in the second form and copy key values from the first form using
'javascript' before submitting the form.

the second form can be like this :

 <form action="http://gmw_ocr_biren:8080/servlet/srvtdel"
 method="post" name="del" onsubmit="check1()">
    <input type=hidden name='Name'></input>
    <input type=hidden name='phNo'></input>
     <p align="center"><input type="submit" name="delete"
     value="Delete"> </p>
 </form>
 </body>

the checkl which you are calling before submit should copy the values
from the first form before explicitly submitting it.

like :

 function check1()
   {
        document.forms[1].Name.value=document.forms[0].T1.value;
        document.forms[1].phNo.value=document.forms[0].T2.value;
        //      so on... for other fields
        document.forms[1].submit();
   }

hope i have got your question right, and my answer helps you out.

regards
vishwa
Biren Patnaik wrote:
>
> Hi All,
> I m working with servlet(JSDK2.1) and oracle as database.My problem is how
> to interact variables between 2forms in a HTML file.
> My aim is to insert record and delete records from the database.
> Insertion of records works fine.But deletion of records dose not. Is it
> the reason that I m accessing the same variables in 2 different forms or
> any other reason?.I will give u the servlet program for insertion of
> records and deletion of records.
> Any one who can help me solving this problem.
> I will write the complete codes here.
>
> 1.)Codes for HTML file
>
>   <html>
>
> <head>
> <meta http-equiv="Content-Type"
> content="text/html; charset=iso-8859-1">
> <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
> <title></title>
> </head>
>
> <body background="http://net/srvt/vnet.jpg" text="#FF0000">
> <script language="javascript">
> function check()
> {
> // alert("ok");
> }
> function check1()
> {
> // alert("ok");
> }
> </script>
>
> <form action="http://gmw_ocr_biren:8080/servlet/srvtx4"
> method="post" name="Add" onsubmit="check()">
>     <p align="center">Enter Name <input type="text" size="10"
>     name="T1"><select name="D1" size="1">
>         <option>January</option>
>         <option>February</option>
>         <option>March</option>
>     </select></p>
>     <p align="center">Enter Phone <input type="text" size="10"
>     name="T2"></p>
>     <p align="center"><input type="submit" name="Insert"
>     value="    Add"> </p>
> </form>
>
> <form action="http://gmw_ocr_biren:8080/servlet/srvtdel"
> method="post" name="del" onsubmit="check1()">
>     <p align="center"><input type="submit" name="delete"
>     value="Delete"> </p>
> </form>
> </body>
> </html>
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to