?
Solved

Hyperlink and Form Question

Posted on 2001-06-20
4
Medium Priority
?
214 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 120 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Suggested Courses

809 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