Hyper link with property value as form field

Hi,

I have a form with two fields

One is a text field AA where user enters a text "PC-1234"

Then the other field shall after save be a hyperlink field containing "the web url"+field AA value

Http://webpageABC.com/PC1234

so user can click on the hyperlink and have the web page opened in a new window

I've been looking around in some old post's but not been able to solve it

Please help

//Mikael

Parents
  • OK, I have solved one of the issues I had with this

    I can now update a field with the "url"+ "value from another field"

    my code to run in OnBeforeUpdate and OnBeforeAdd

    //my code----

    Innovator inn = this.getInnovator();


    string AA = "my URL"+this.getProperty("field with value");
    this.setProperty("my field with complete URL", AA.ToString());

    return this;

    //-----------

    So how can I now set "my field with complete URL" to present it as an clickable hyperlink??

  • Hi MKalla

    I guess you need to use HTML to create the link.

    Step 1: Create a HTML element in your form

    Step 2: Add the below Code in HTML Code

    <a id="newlink" href="#" onclick="return showURL();" target="_blank" style="color: #3668B1;text-decoration: underline">Click Here</a>
    <script>
    function showURL() {
    debugger;
    var description = document.thisItem.getProperty("description");
    var baseURL = "https://www.w3schools.com/";
    var specificURL = "";
    if (description) {
    specificURL = baseURL + description;
    document.getElementById("newlink").href = specificURL ;
    } else {
    top.aras.AlertError("Please Enter the field with value.");
    return false;
    }
    };
    </script>

    Step 3: Save Form

    Here description tag is the dynamic value field you want to append to URL. Let me know if it helps.

    Thank You

    Gopikrishnan R

Reply
  • Hi MKalla

    I guess you need to use HTML to create the link.

    Step 1: Create a HTML element in your form

    Step 2: Add the below Code in HTML Code

    <a id="newlink" href="#" onclick="return showURL();" target="_blank" style="color: #3668B1;text-decoration: underline">Click Here</a>
    <script>
    function showURL() {
    debugger;
    var description = document.thisItem.getProperty("description");
    var baseURL = "https://www.w3schools.com/";
    var specificURL = "";
    if (description) {
    specificURL = baseURL + description;
    document.getElementById("newlink").href = specificURL ;
    } else {
    top.aras.AlertError("Please Enter the field with value.");
    return false;
    }
    };
    </script>

    Step 3: Save Form

    Here description tag is the dynamic value field you want to append to URL. Let me know if it helps.

    Thank You

    Gopikrishnan R

Children