Solved

Hyperlink and Form Question

Posted on 2001-06-20
4
172 Views
Last Modified: 2010-04-09
With a form you can set the method attribute to get or post.  if you use post the name-value pairs do not show in address bar.  if you use the get method they do.  

If you have a hyperlink that has name-value pairs they show in the address bar.  is there any way to prevent the name-value pairs from showing in the address bar with a hyperlink?

So far to get around this problem i have just created a simple form with the method set to post and hidden fields, and a submit button.  however, i would prefer to use a hyperlink.  the submit buttons just don't look right.  

If you have any questiosn about what i am trying to do let me know.  thanks
0
Comment
Question by:FranzRinkleff
4 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 6210918
Let me see if I have this right...

You have a link to a cgi/asp/php/something that requires you to pass parameters/variables, and you don't want them to show up in the address bar. Is this right?

If you want a standard link -- you'll have to live with it.

You can do what you've done and set it as a form, and use the hidden fields. There are lots of ways to submit a form other than the standard submit buttons. You can set a dummy link with an onclick event that submits the form. You can set an image as the submit button. Both options will work, and won't look like a form.
0
 
LVL 3

Accepted Solution

by:
ckaneta earned 30 total points
ID: 6211207
why not just create the form minus the submit button and then have a hyperlink to submit it

<script language=javascript>
function formsub(){
 . . .
 document.MyForm.submit();
}
</script>
<form name="MyForm" ...>
...
...
</form>

<a href="javascript:formsub();">Submit</a>
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6213636
It all depends...if you are using a frameset the name-value pair doesn't have to show up in the address bar...if you do not use a frameset they will....

And if you are worried about the submit buttons not looking right why not create your own one (image) and use <input type="image" src="yourimage.gif"> instead....

The input type=image defaults to the same function as a submit button does so that would get rid of your problem that it doesn't look right..

Max.
0
 
LVL 1

Author Comment

by:FranzRinkleff
ID: 6214663
Thanks, all of the comments were good.  I liked this one the best.  Should have thought of it on my own. Franz
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Printing a Google Form 2 25
Asp.net mvc foreach 3 34
Tableau and Javascript: How to export an array to excel with formatting 11 59
Problem with a CSS in a page 2 26
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now