Field with clickable URL

Hello,

i have a field “telephone” in my form / editable grid. This field should look like a URL:

field telephone: 1234567890
field URL : http://192.168.222.26/index.htm?NUMBER=1234567890&DIAL=1

This is not a problem (changed in onRecord), but when i edit the record, the field value is “<a href …” and not “01234567890”.

My question: how do I display the url only if the record is not in edit mode?

Re: Field with clickable URL

Nobody has any idea?

Re: Field with clickable URL

look at the manual for sc_btn_update, sc_btn_new, sc_btn_delete

onLoad:

if (!(sc_btn_new))
{
{field} = “http://192.168.222.26/index.htm?NUMBER=”. {field} ."&DIAL=1";
sc_field_readonly({field}, on);
}

Re: Field with clickable URL

Hi Diogo,

i have tested your example, but that does not work, because the status of the field is still read-only after click on “Edit” and the first call of the form is without a (field-)link.

The status for sc_btn_update etc. will be changed only if the form is opened in each mode, but not if you click on Edit, New or Delete. Is this a bug or a mistake from me?

Re: Field with clickable URL

The sc_btn_update only is setted when you click on the the update button.

Thats why i write the code

if (!(sc_btn_new))

. Thats mean: when updating and deleting.

But this code is wrong … if you add this:
{field} = “http://192.168.222.26/index.htm?NUMBER=”. {field} ."&DIAL=1";
to a readonly field, the field will be http://192.168.222.26/index.htm?NUMBER121234DIAL=1

So if you want to display a link, you must do this:

{field} = “<a href='http://192.168.222.26/index.htm?NUMBER=”. {field} ."&DIAL=1’>". {field} ."</a>";

Re: Field with clickable URL

Hi Diogo,

I had already corrected the link … that is not the problem. Make a try for yourself:

This Code …

if (!(sc_btn_new))
{
	{field} = "<a href='http://192.168.222.26/index.htm?NUMBER=". {field} ."&DIAL=1'>". {field} ."</a>";	
	sc_field_readonly({field}, on);
}

… in a Form (Editable Grid View) on Event onLoad shows

  • the first call without a (field-)link -> not ok
  • the field is still readonly after click on Edit -> not ok

… in a Form (Editable Grid View) on Event onLoadRecord shows

  • the field with link -> ok
  • but the field is still readonly after click on Edit -> not ok

The Code without sc_field_readonly shows the fieldvalue with “<a href …”, but the link will not be saved.

Re: Field with clickable URL

Hi Diogo,

have you tried this?

Thanks.

Re: Field with clickable URL

When you click on the update button on a form single record, the form submit and open with the fields empty. The onload is executed, so sc_btn_update too.

But in editable grid, note that the form is not reloaded.

Now you got me.