473,385 Members | 1,292 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,385 software developers and data experts.

Post Data with Javascript and without using a form tag.

Neo
can anybody help me in writing a javascript function which opens a
popup window with the target URL when the link "POST Request" is
clicked..

Points to note:

The HTML DOESNT and SHOULDNT HAVE A FORM TAG.
The URL data should be sent as POST and not GET..i.e the search
parameters should not be showin in the address bar when the page is
opened.
Sample code is:

<script language="JavaScript">
<!--

function Openlink(url, args)
{
/////////////FILL CODE HERE...
}

// -->
</script>
<!-- ****************** Change nothing below here ************** -->

<body>
<a href="#wf" onClick="javascript:LinkOpener('http://www.ntis.gov/search/results.asp?loc=3-0-0&search=','frm_qry_Category=ALL&frm_qry_Search=ea rth&frm_qry_Search=AND&frm_qry_Search=&frm_qry_Sea rch=AND&frm_qry_Search=&frm_qry_Year=1990&frm_qry_ MaxRec=100&frm_qry_Rank=1')">POST
request</a>
</body>
</html>

Thanks.
Jul 20 '05 #1
2 27933
One thing you could do is to have a dummy form,
and when you click on your desired link it fills in
the desired hidden fields and submits the form.

Oops, I see that you have the field (element) names
contained in the query. OK, you can just generate
those hidden INPUT elements yourself and then
fill in their values.

Good luck,
Csaba Gabor from New York

"Neo" <ni*******@yahoo.com> wrote in message news:86*************************@posting.google.co m...
can anybody help me in writing a javascript function which opens a
popup window with the target URL when the link "POST Request" is
clicked..

Points to note:

The HTML DOESNT and SHOULDNT HAVE A FORM TAG.
The URL data should be sent as POST and not GET..i.e the search
parameters should not be showin in the address bar when the page is
opened.
Sample code is:

<script language="JavaScript">
<!--

function Openlink(url, args)
{
/////////////FILL CODE HERE...
}

// -->
</script>
<!-- ****************** Change nothing below here ************** -->

<body>
<a href="#wf" onClick="javascript:LinkOpener('http://www.ntis.gov/search/results.asp?loc=3-0-0&search=','frm_qry_Category=ALL&frm_q
ry_Search=earth&frm_qry_Search=AND&frm_qry_Search= &frm_qry_Search=AND&frm_qry_Search=&frm_qry_Year=1 990&frm_qry_MaxRe
c=100&frm_qry_Rank=1')">POST request</a>
</body>
</html>

Thanks.

Jul 20 '05 #2
Neo
Hi there,
Thanks for the reply..
I tried and I got the script working. :)
Just had to generate a new "form" thru javascript. Had to then parse
the querystring and store them in an array and pass the hidden values.
The form action is post. The hidden variables along with the form
action is submitted thru a popup window..

Thanks again for replying :)
cheers !
Jul 20 '05 #3

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

Similar topics

5
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the...
7
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open...
4
by: Dodo | last post by:
Is it possible to create a link that can post a value to an ASP page without java?
2
by: Matt | last post by:
When we submit the form data to another page, we usually do the following: <form action="display.aspx" method="post"> will submit the form data and open display.asp in the current browser ...
4
by: dschruth | last post by:
Hello. Can anybody solve this problem? I am using a server-side language (PERL) to *try* to POST data to a HTTPS login script that doesn't have a standard "submit" button. The form appears...
23
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of...
10
by: eggie5 | last post by:
Is it possible to get a file without using a form post? I want to get the data (bytes) of a file, text or binary, and just save it to a variable. Similar to the post body of a form that has a...
2
by: rynato | last post by:
I have a form which the user fills out to enter some data. If there already exists an uncompleted session - say, the user started entering some data but had to stop to do something else - the...
56
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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...

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.