Solved

Hyperlink and Form Question

Posted on 2001-06-20
4
187 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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 …

792 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