How to pass the value for Hyperlink->HREF field in Field Setup in server event?

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
yinsw
User
Posts: 148
Location: Penang, Malaysia

How to pass the value for Hyperlink->HREF field in Field Setup in server event?

Post by yinsw »

I have a field that store full URL in URL-encoded form. For example: https%3A%2F%2Fwww.mysite.com%2FGetReceipt%3Freceiptno%3D0116021K4A000

If I set the field in Hyperlink -> HREF field, the link won't parse properly. It needs to be decoded first by using php urldecode function so it will show as https://www.mysite.com/GetReceipt?receiptno=0116021K4A000

How can I update the value from server event? I can't find the correct property for it.


arbei
User
Posts: 9384

Post by arbei »

You may try to use Row_Rendered server event to URL-decode the field object's HrefValue property first.


yinsw
User
Posts: 148
Location: Penang, Malaysia

Post by yinsw »

Thanks. I did try earlier but I assigned to the wrong field. It's correct now for me. Thanks.

    if ($this->RECEIPTURL->CurrentValue<>""){
        $this->RECEIPTNO->HrefValue = urldecode($this->RECEIPTURL->CurrentValue);
    }

Post Reply