Solved

Hyperlink and Form Question

Posted on 2001-06-20
4
162 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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…

772 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

11 Experts available now in Live!

Get 1:1 Help Now