Solved

submit from a text link - with a twist

Posted on 2008-06-11
4
166 Views
Last Modified: 2013-12-25
I have a form and due to client demands they want to be able to click a text link to submit the form.  So the link looks like this: <a href="#" onclick="document.theForm.submit()">Click here to view</a>

the problems are, a) this is a cgi page, b) there is a <base> tag defined<base href="mydomain.com">. So clicking the link, actually takes me to mydomain.com/# instead of just leaving me at my current location.  Putting in the full path to the page in the href causes me to lose my form data.

Can anybody help me resolve this?
0
Comment
Question by:healthstatus
[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
  • 3
4 Comments
 
LVL 11

Accepted Solution

by:
JohnSixkiller earned 500 total points
ID: 21759772
Hi,

try

<a href="javascript:void(0)" onclick="document.theForm.submit()">Click here to view</a>
0
 
LVL 11

Expert Comment

by:JohnSixkiller
ID: 21759839
Another solution:

<a href="#" onclick="document.theForm.submit(); return false;">Click here to view</a>
0
 
LVL 2

Author Closing Comment

by:healthstatus
ID: 31466140
Thanks John!
0
 
LVL 11

Expert Comment

by:JohnSixkiller
ID: 21766584
You are welcome.
0

Featured Post

Independent Software Vendors: 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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
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…

628 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