Jump to content

onclick event and function call to create dynamic URL links


Recommended Posts

Hi

I have the following link in an HTML block of a details page

[url="#"]next test[/url]

which works correctly. Next I replaced code in the HTML block as follows

[url="#"]test 501[/url]

with the following in the footer

<script>

function membershipType1()
{
		window.alert('I am an alert box');

}
</script

And I just cannot get it to work! Any help would be really appreciated

Link to comment
Share on other sites

Finally fixed this so have posted solution below for others who may have simialr problems. It is used on a detail's datapage report and it is referencing a field in the underlying authentication table rather than the table that the datapage itself is built on.

//This code is in an HTML block on the datpage..
//demonstration of onclick functionality javascript..

	[url="#"]View[/url]

//this code is in the footer..	
//the function calls...

<script type="text/javascript" language="JavaScript">

function membershipType1(trialStatus)
{

	if (trialStatus == ("active"))  {

		window.location="http://cool-wedding.co.uk/my-dashboard/supplier-dashboard/active-trial-membership";

		}

	else if (trialStatus == ("ended")) {

		window.location="http://cool-wedding.co.uk/my-dashboard/bride-dashboard/my-membership";

		}
		
	else {
	
		window.alert('this is a bug! Please can you report it to support. Thanks');
		
	}
}

</script>
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...