Hi folks I tried my best but cud not come to any conclusion Can any one tell me that if on click of submit button when i call a servlet .if i want that servlet to be opened in a new window instead of the same browser is it possible if yes cana anyone pls tell me how it is possible i tried it thru calling a function on the event onSubmit but that also donot serve the purpose Thnkx in advance for any of your views Gaurav
SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
Its possible using Javascript I exactly do not know the syntax in Javascript it should be like window .open() which opens a new window and I hope you can also pass the pass the url as parameter of the servlet that you would want to be evoked or a html pages Regards
Take up computer programming as fun and you will just enjoy it. Always keep in mind that in some way your program is going to make human life easier.
Gaurav Chikara
Ranch Hand
Joined: Jun 09, 2000
Posts: 410
posted
0
Hi narayan i appreciate ur reply but thru javascript it is only possible if we are not using submit button but i m using submit button and on its click only one operation is performed and that is invoking of the servlet with in same browser so my problem is still confusing even if i use onClick on submit button then also popup window opens but simultanously the servlet gets called with in the same browser any other views are welcome Gaurav
Originally posted by narayan kulkarni: Its possible using Javascript I exactly do not know the syntax in Javascript it should be like window .open() which opens a new window and I hope you can also pass the pass the url as parameter of the servlet that you would want to be evoked or a html pages Regards
I just tried this for you. The following is the html and servlet code for your perusal. I think it meets your requirement(opens servlet in a new window) HTML Code ---------- <HTML> <HEAD> <TITLE>TESTING</TITLE> </HEAD> <BODY bgcolor=white> <FORM name="Form" onSubmit="return func();" > <center><b> ID Number:�<input type="text" name="Userid" value="Ajan" SIZE=20 MAXLENGTH=9 ><br> Password���:�<input type="password" name="Password" value="ferrari" SIZE=20><br>
function func() { var var1 = Form.Userid.value; var var2 = Form.Password.value; var var3 = "http://localhost:8080/servlet/PostServlet?Userid="+ var1 +"&Password="+ var2;
Ajan [This message has been edited by Ajan Balakrishnan (edited February 01, 2001).] [This message has been edited by Ajan Balakrishnan (edited February 01, 2001).]
Gaurav Chikara
Ranch Hand
Joined: Jun 09, 2000
Posts: 410
posted
0
Thnkx ajan it really resolved my doubts i m thankful to ya have a nice day Gaurav
Originally posted by Ajan Balakrishnan: I just tried this for you. The following is the html and servlet code for your perusal. I think it meets your requirement(opens servlet in a new window) HTML Code ---------- <HTML> <HEAD> <TITLE>TESTING</TITLE> </HEAD> <BODY bgcolor=white> <FORM name="Form" onSubmit="return func();" > <center><b> ID Number:�<input type="text" name="Userid" value="Ajan" SIZE=20 MAXLENGTH=9 ><br> Password���:�<input type="password" name="Password" value="ferrari" SIZE=20><br>
function func() { var var1 = Form.Userid.value; var var2 = Form.Password.value; var var3 = "http://localhost:8080/servlet/PostServlet?Userid="+ var1 +"&Password="+ var2;
Ajan [This message has been edited by Ajan Balakrishnan (edited February 01, 2001).] [This message has been edited by Ajan Balakrishnan (edited February 01, 2001).]
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.