473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can we click a link and it will submit the form to the other page?

Can we click a link and it will submit the form to the other page?
Usually we will submit the
form to other page by clicking a submit button.

Now I need to do the following, but what if I have many data in the
form? Any workarounds?
<a href="http://myserver/index.jsp?name=test&actionType=test"
target="_blank">Add New Document</a>

Please advise. thanks!!
Jul 23 '05 #1
2 2072
Matt wrote:
Can we click a link and it will submit the form to the other page?
Usually we will submit the
form to other page by clicking a submit button.

Now I need to do the following, but what if I have many data in the
form? Any workarounds?
<a href="http://myserver/index.jsp?name=test&actionType=test"
target="_blank">Add New Document</a>

Please advise. thanks!!


Why not just use a submit button and be done with it?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
In article <ba**************************@posting.google.com >,
jr********@hotmail.com enlightened us with...
Can we click a link and it will submit the form to the other page?
Usually we will submit the
form to other page by clicking a submit button.

Now I need to do the following, but what if I have many data in the
form? Any workarounds?
<a href="http://myserver/index.jsp?name=test&actionType=test"
target="_blank">Add New Document</a>

Please advise. thanks!!


Yes, but note that it can die in non-supporting browsers. I don't recommend
it for the 'net.
Intranet is fine.

This is what I do.

-- actual code from generated page, modified for sensitive content --

<td>
<form name='otFrm11' action='admnType.jsp' method='get'>
<input type='hidden' name='Type' value='WIRELESS'><input type='hidden'
name='description' value='Wireless'><input type='hidden' name='status'
value='1'></form>
<a href="javascript:document.forms['otFrm11'].submit();">WIRELESS</a></td>

-- end code --

Note that I am using the javascript protocol for a link. This is not
recommended for general use and is not very cross-browser. This works in IE6
and NN7, the only browsers I need to care about. If you need it more cross-
browser, remove the script from the href and put it in onClick and put a real
location in the href.
<a href="someNonJsPage.html" onClick="document.forms['formname'].submit()">

If the submit (target of the form or a function that opens a new window and
sets target) is to a different window, add "return false" to the onClick so
the href isn't followed in the main page.
<a href="someNonJsPage.html" onClick="document.forms['formname'].submit();
return false;">

HTH
--
--
~kaeli~
He's your God, they're your rules - you burn in Hell.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: VbUser25 | last post by:
hi.. i have a form i accept some user inputs in the form. there is a link on the form from where i open the excel file in the same browser (not in a new page...simply using a href. i am also...
0
by: Juan Jose Costello Levien | last post by:
Hello, My name is Juan. I am new to the forum. Here I leave you a problem to see if you can help me. General Description I am developing an application in Visual Basic 6.
3
by: Epetruk | last post by:
Hi, I'm trying to design a simple web form, but I cannot get the code in the btnSubmit_ServerClick event to fire. What am I doing wrong? Here's the codebehind: using System; using...
0
by: Demetri | last post by:
I have created a web control that can be rendered as either a linkbutton or a button. It is a ConfirmButton control that allows a developer to force a user to confirm if they intended to click it...
5
by: mayur_hirpara | last post by:
Hi, I have been developing web applications for a while now. However, as I was thinking through the architecture I really don't understand the "How server can identify between which buttons has...
4
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I...
26
by: Mica Cooper | last post by:
Hi, I need to pass some info in a javascript submit. <a href="javascript:document.formName.submit();">Submit Form</a> Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1,...
11
by: yangsuli | last post by:
i want to creat a link when somebody click the link the php script calls a function,then display itself :) i have tried <a href=<? funtion(); echo=$_server ?>text</a> but it will call the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.