473,396 Members | 2,039 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,396 software developers and data experts.

Send a URL composed from form fields?

I am trying to compose a URL from form fields and then send it but being a novice in java I haven't managed to work it out. In straight html my URL is something like:
<a target="_blank" href="/apps/bbsearch/esearch.aspx?&metaGE3=variable1&metaGE2=variable2& metaSE4=variable3&run=yes&bank=CB1"></a>
All I want to is gather the variables from the form (I know how to do that) but then get a button to do the rest.
Any guidance would be welcome.
Jul 11 '07 #1
2 1553
epots9
1,351 Expert 1GB
I am trying to compose a URL from form fields and then send it but being a novice in java I haven't managed to work it out. In straight html my URL is something like:
<a target="_blank" href="/apps/bbsearch/esearch.aspx?&metaGE3=variable1&metaGE2=variable2& metaSE4=variable3&run=yes&bank=CB1"></a>
All I want to is gather the variables from the form (I know how to do that) but then get a button to do the rest.
Any guidance would be welcome.
Hi Albro27 welcome to TSDN,
take a look at this:
[HTML]
<form name="myForm" id="myForm">
<input type="text" name"field1" id="field1" />
<input type="text" name"field2" id="field2" />
<input type="button" name="button1" id="button1" value="Click Me" onclick="myFunction();" />
</form>
[/HTML]

Expand|Select|Wrap|Line Numbers
  1. function myFunction()
  2. {
  3. var value1 = document.getElementById("field1").value;
  4. var value2 = document.getElementById("field2").value;
  5. var url = "apps/bbsearch/esearch.aspx" + "?first=" + value1 + "&second=" + value2;
  6. window.open(url, "My New Page");
  7. }
  8.  
good luck
Jul 11 '07 #2
acoder
16,027 Expert Mod 8TB
How about just using the GET method to do it automatically for you instead? You could send the data to a new window by using the target attribute.
Jul 12 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Andrew Williams | last post by:
Hi, I have just created a web form that should send its details to an e-mail address. The problem is that I was working on the pretense that CDONTS would suffice my needs. However, after...
1
by: ij | last post by:
Hi, I'm trying to submit an image object, along with some other text fields to another web server from within an ASP page but am stuck on getting the image to be submitted with the form. In a...
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
1
by: Miguel Dias Moura | last post by:
Hello, Can you help me out in making this work? What I want is as simple as sending form values to an email. The code I am using is the following:
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
5
by: trig | last post by:
Please help! I am an ICT teacher at a secondary school and my year 12 (AS Level) group need to create a website where data can be sent from a form to a Microsoft Access database. I am trying...
2
by: kennykenn | last post by:
Hi, Ive producd code to send an email after capturing info off a form,it works fine locally but when i put it live it doesnt work! the code is stopin at 'msg.send' any ideas, here the code! ...
1
by: maxxxxel | last post by:
Hi Can anyone help me with some asp code , I changed the code to use CDO.message instead of the old cdont.sys to send mail from a ASP webpage which works fine. Our problem is that when we send...
1
by: phuc2583 | last post by:
I will try my best to send email(abc@nhatranglive,support@nhatranglive),but i can not sent it i will try again another email address(phuc2583@gmail,phuc2583@yahoo.com), so it sent well, This is my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.