Link to home
Start Free TrialLog in
Avatar of healthstatus
healthstatus

asked on

submit from a text link - with a twist

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?
ASKER CERTIFIED SOLUTION
Avatar of JohnSixkiller
JohnSixkiller
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Another solution:

<a href="#" onclick="document.theForm.submit(); return false;">Click here to view</a>
Avatar of healthstatus
healthstatus

ASKER

Thanks John!
You are welcome.