Skip to main content
added 5 characters in body
Source Link
Niko
  • 2.8k
  • 2
  • 10
  • 25

You can see different examples of having a button with a link in Email (will not allow to properly preview Button #4) or CloudPage and only Button #2 and #6 are not working, other variants should be sufficient for you to use:

%%[ SET @link = Lookup("DE_Name", "URL", "Field_identifier", "Value_identifier") ]%%
<body>
        <p>Button #1 - Example of adding an onclick event to the button tag</p>
        <form action="%%=v(@link)=%%" method="post">
            <input type="submit" value="Button #1">
        </form>
    <br/>
        <p>Button #2 - Example of adding an onclick event to the input tag</p>
        <form>
            <input type="button" onclick="%%=v(@link)=%%';" value="Button #2" />
        </form>
    <br/>
        <p>Button #3 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@link)=%%">
            <button type="submit">Button #3</button>
        </form>
    <br/>
        <p>Button #4 - Example of creating a button acting like a link with the formaction attribute</p>
        <form>
            <button type="submit" formaction="%%=v(@link)=%%">Button #4</button>
        </form>
    <br/>
        <p>Button #5 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@link)=%%" method="get" target="_blank">
            <button type="submit">Button #5</button>
        </form>
    <br/>
        <p>Button #6 - Example of adding an onclick event to the button tag</p>
        <button onclick="%%=v(@link)=%%">Button #6</button>
</body>

The last, 7th variant also allows you to put %%=v(@link)=%% into the "Link URL" field inside Button properties when you are creating an email via Drag&Drop approach and once clicked open the link.

You can see different examples of having a button with a link in Email (will not allow to properly preview Button #4) or CloudPage and only Button #2 and #6 are not working, other variants should be sufficient for you to use:

%%[ SET @link = Lookup("DE_Name", "URL", "Field_identifier", "Value_identifier") ]%%
<body>
        <p>Button #1 - Example of adding an onclick event to the button tag</p>
        <form action="%%=v(@link)=%%" method="post">
            <input type="submit" value="Button #1">
        </form>
    <br/>
        <p>Button #2 - Example of adding an onclick event to the input tag</p>
        <form>
            <input type="button" onclick="%%=v(@link)=%%';" value="Button #2" />
        </form>
    <br/>
        <p>Button #3 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@link)=%%">
            <button type="submit">Button #3</button>
        </form>
    <br/>
        <p>Button #4 - Example of creating a button acting like a link with the formaction attribute</p>
        <form>
            <button type="submit" formaction="%%=v(@link)=%%">Button #4</button>
        </form>
    <br/>
        <p>Button #5 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@link)=%%" method="get" target="_blank">
            <button type="submit">Button #5</button>
        </form>
    <br/>
        <p>Button #6 - Example of adding an onclick event to the button tag</p>
        <button onclick="%%=v(@link)=%%">Button #6</button>
</body>

The last variant also allows you to put %%=v(@link)=%% into the "Link URL" field inside Button properties when you are creating an email via Drag&Drop approach and once clicked open the link.

You can see different examples of having a button with a link in Email (will not allow to properly preview Button #4) or CloudPage and only Button #2 and #6 are not working, other variants should be sufficient for you to use:

%%[ SET @link = Lookup("DE_Name", "URL", "Field_identifier", "Value_identifier") ]%%
<body>
        <p>Button #1 - Example of adding an onclick event to the button tag</p>
        <form action="%%=v(@link)=%%" method="post">
            <input type="submit" value="Button #1">
        </form>
    <br/>
        <p>Button #2 - Example of adding an onclick event to the input tag</p>
        <form>
            <input type="button" onclick="%%=v(@link)=%%';" value="Button #2" />
        </form>
    <br/>
        <p>Button #3 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@link)=%%">
            <button type="submit">Button #3</button>
        </form>
    <br/>
        <p>Button #4 - Example of creating a button acting like a link with the formaction attribute</p>
        <form>
            <button type="submit" formaction="%%=v(@link)=%%">Button #4</button>
        </form>
    <br/>
        <p>Button #5 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@link)=%%" method="get" target="_blank">
            <button type="submit">Button #5</button>
        </form>
    <br/>
        <p>Button #6 - Example of adding an onclick event to the button tag</p>
        <button onclick="%%=v(@link)=%%">Button #6</button>
</body>

The last, 7th variant also allows you to put %%=v(@link)=%% into the "Link URL" field inside Button properties when you are creating an email via Drag&Drop approach and once clicked open the link.

added 69 characters in body
Source Link
Niko
  • 2.8k
  • 2
  • 10
  • 25

You can see different examples of having a button with a link in Email (will not allow to properly preview Button #4) or CloudPage and only Button #2 and #6 are not working, other variants should be sufficient for you to use:

%%[ SET @var1@link = Lookup("DE_Name", "URL", "Field_identifier", "Value_identifier") ]%%
<body>
        <p>Button #1 - Example of adding an onclick event to the button tag</p>
        <form action="%%=v(@var1@link)=%%" method="post">
            <input type="submit" value="Button #1">
        </form>
    <br/>
        <p>Button #2 - Example of adding an onclick event to the input tag</p>
        <form>
            <input type="button" onclick="%%=v(@var1@link)=%%';" value="Button #2" />
        </form>
    <br/>
        <p>Button #3 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@var1@link)=%%">
            <button type="submit">Button #3</button>
        </form>
    <br/>
        <p>Button #4 - Example of creating a button acting like a link with the formaction attribute</p>
        <form>
            <button type="submit" formaction="%%=v(@var1@link)=%%">Button #4</button>
        </form>
    <br/>
        <p>Button #5 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@var1@link)=%%" method="get" target="_blank">
            <button type="submit">Button #5</button>
        </form>
    <br/>
        <p>Button #6 - Example of adding an onclick event to the button tag</p>
        <button onclick="%%=v(@var1@link)=%%">Button #6</button>
</body>

The last variant also allows you to put %%=v(@link)=%% into the "Link URL" field inside Button properties when you are creating an email via Drag&Drop approach and once clicked open the link.

You can see different examples of having a button with a link in Email (will not allow to properly preview Button #4) or CloudPage and only Button #2 and #6 are not working, other variants should be sufficient for you to use:

%%[ SET @var1 = Lookup("DE_Name", "URL", "Field_identifier", "Value_identifier") ]%%
<body>
        <p>Button #1 - Example of adding an onclick event to the button tag</p>
        <form action="%%=v(@var1)=%%" method="post">
            <input type="submit" value="Button #1">
        </form>
    <br/>
        <p>Button #2 - Example of adding an onclick event to the input tag</p>
        <form>
            <input type="button" onclick="%%=v(@var1)=%%';" value="Button #2" />
        </form>
    <br/>
        <p>Button #3 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@var1)=%%">
            <button type="submit">Button #3</button>
        </form>
    <br/>
        <p>Button #4 - Example of creating a button acting like a link with the formaction attribute</p>
        <form>
            <button type="submit" formaction="%%=v(@var1)=%%">Button #4</button>
        </form>
    <br/>
        <p>Button #5 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@var1)=%%" method="get" target="_blank">
            <button type="submit">Button #5</button>
        </form>
    <br/>
        <p>Button #6 - Example of adding an onclick event to the button tag</p>
        <button onclick="%%=v(@var1)=%%">Button #6</button>
</body>

You can see different examples of having a button with a link in Email (will not allow to properly preview Button #4) or CloudPage and only Button #2 and #6 are not working, other variants should be sufficient for you to use:

%%[ SET @link = Lookup("DE_Name", "URL", "Field_identifier", "Value_identifier") ]%%
<body>
        <p>Button #1 - Example of adding an onclick event to the button tag</p>
        <form action="%%=v(@link)=%%" method="post">
            <input type="submit" value="Button #1">
        </form>
    <br/>
        <p>Button #2 - Example of adding an onclick event to the input tag</p>
        <form>
            <input type="button" onclick="%%=v(@link)=%%';" value="Button #2" />
        </form>
    <br/>
        <p>Button #3 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@link)=%%">
            <button type="submit">Button #3</button>
        </form>
    <br/>
        <p>Button #4 - Example of creating a button acting like a link with the formaction attribute</p>
        <form>
            <button type="submit" formaction="%%=v(@link)=%%">Button #4</button>
        </form>
    <br/>
        <p>Button #5 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@link)=%%" method="get" target="_blank">
            <button type="submit">Button #5</button>
        </form>
    <br/>
        <p>Button #6 - Example of adding an onclick event to the button tag</p>
        <button onclick="%%=v(@link)=%%">Button #6</button>
</body>

The last variant also allows you to put %%=v(@link)=%% into the "Link URL" field inside Button properties when you are creating an email via Drag&Drop approach and once clicked open the link.

added 69 characters in body
Source Link
Niko
  • 2.8k
  • 2
  • 10
  • 25

You can see different examples of having a button with a link in Email (will not allow to properly preview Button #4) or CloudPage and only Button #2 and #6 are not working, other variants should be sufficient for you to use:

%%[ SET @var1 = Lookup("DE_Name", "URL", "Field_identifier", "Value_identifier") ]%%
<body>
        <p>Button #1 - Example of adding an onclick event to the button tag</p>
        <form action="%%=v(@var1)=%%" method="post">
            <input type="submit" value="Button #1">
        </form>
    <br/>
        <p>Button #2 - Example of adding an onclick event to the input tag</p>
        <form>
            <input type="button" onclick="%%=v(@var1)=%%';" value="Button #2" />
        </form>
    <br/>
        <p>Button #3 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@var1)=%%">
            <button type="submit">Button #3</button>
        </form>
    <br/>
        <p>Button #4 - Example of creating a button acting like a link with the formaction attribute</p>
        <form>
            <button type="submit" formaction="%%=v(@var1)=%%">Button #4</button>
        </form>
    <br/>
        <p>Button #5 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@var1)=%%" method="get" target="_blank">
            <button type="submit">Button #5</button>
        </form>
    <br/>
        <p>Button #6 - Example of adding an onclick event to the button tag</p>
        <button onclick="%%=v(@var1)=%%">Button #6</button>
</body>

You can see different examples of having a button with a link and only Button #2 and #6 are not working, other variants should be sufficient for you to use:

%%[ SET @var1 = Lookup("DE_Name", "URL", "Field_identifier", "Value_identifier") ]%%
<body>
        <p>Button #1 - Example of adding an onclick event to the button tag</p>
        <form action="%%=v(@var1)=%%" method="post">
            <input type="submit" value="Button #1">
        </form>
    <br/>
        <p>Button #2 - Example of adding an onclick event to the input tag</p>
        <form>
            <input type="button" onclick="%%=v(@var1)=%%';" value="Button #2" />
        </form>
    <br/>
        <p>Button #3 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@var1)=%%">
            <button type="submit">Button #3</button>
        </form>
    <br/>
        <p>Button #4 - Example of creating a button acting like a link with the formaction attribute</p>
        <form>
            <button type="submit" formaction="%%=v(@var1)=%%">Button #4</button>
        </form>
    <br/>
        <p>Button #5 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@var1)=%%" method="get" target="_blank">
            <button type="submit">Button #5</button>
        </form>
    <br/>
        <p>Button #6 - Example of adding an onclick event to the button tag</p>
        <button onclick="%%=v(@var1)=%%">Button #6</button>
</body>

You can see different examples of having a button with a link in Email (will not allow to properly preview Button #4) or CloudPage and only Button #2 and #6 are not working, other variants should be sufficient for you to use:

%%[ SET @var1 = Lookup("DE_Name", "URL", "Field_identifier", "Value_identifier") ]%%
<body>
        <p>Button #1 - Example of adding an onclick event to the button tag</p>
        <form action="%%=v(@var1)=%%" method="post">
            <input type="submit" value="Button #1">
        </form>
    <br/>
        <p>Button #2 - Example of adding an onclick event to the input tag</p>
        <form>
            <input type="button" onclick="%%=v(@var1)=%%';" value="Button #2" />
        </form>
    <br/>
        <p>Button #3 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@var1)=%%">
            <button type="submit">Button #3</button>
        </form>
    <br/>
        <p>Button #4 - Example of creating a button acting like a link with the formaction attribute</p>
        <form>
            <button type="submit" formaction="%%=v(@var1)=%%">Button #4</button>
        </form>
    <br/>
        <p>Button #5 - Example of opening a link from a button in a new window</p>
        <form action="%%=v(@var1)=%%" method="get" target="_blank">
            <button type="submit">Button #5</button>
        </form>
    <br/>
        <p>Button #6 - Example of adding an onclick event to the button tag</p>
        <button onclick="%%=v(@var1)=%%">Button #6</button>
</body>
Source Link
Niko
  • 2.8k
  • 2
  • 10
  • 25
Loading