Link to home
Start Free TrialLog in
Avatar of actolex
actolex

asked on

Button used for hyperlink

With the help from someone on this forum, I have created a hyperlink for one of my controls.

My next step is to turn this hyperlink into a button so the path of the link is not shown, but the user will just push the button.

I want to do this because I want to add a rule to close the form once the button is pressed, after the hyperlink is opened.  Right now, I cannot do this if they are just clicking the hyperlink.  I need to get the original form to close to avoid having both open at the same time.

Please let me know if I’m not clear….I look forward to your responses as always....thanks for the super help !!!
Avatar of Nathan Riley
Nathan Riley
Flag of United States of America image

Do you mean like this?

<a href="http://domain.com/yourlink">Button</a>
Avatar of actolex
actolex

ASKER

Is this that the rule to assign the button?

Sorry....I'm a newbie to InfoPath.
In infopath they have hyperlink controls but not as button actions.

I think you can do them with code but the simple fix that I have done is use the hyperlink controls.

But then I right click on my buttons and go to borders and shading.

There I select none for the border and remove the shading.

Then I format the text of the buttons to make them underline.

The result is all of the buttons and hyperlinks look the same. I like it since it gives it more of a browser feel, which many users are accustomed to and it also makes the hypelinks and buttons indestinguishable.
Avatar of actolex

ASKER

I think I'm trying to do the opposite....make a hyperlink look like a button.

If it needs code, I may have to keep the hyperlink.  If I do need to keep it, can I :

Change the text of the hyperlink and not display the path
Add a function to close the current form once the hyperlink is clicked

The hyperlink control allows you to set the text and the actual link seperately.

You can only close the form on a button if you use actions.

So you will have to decide what way works the best for you.
ASKER CERTIFIED SOLUTION
Avatar of melli111
melli111
Flag of United States of America 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
Avatar of actolex

ASKER

Awesome answer !!!!
The last line of code throw an error

this.Close();

InfoPath 2007 Developer Intella-sence finds the "this"  but no ".Close" What's the deal?