Solved

Hyperlink and Form Question

Posted on 2001-06-20
4
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

730 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