Field link in form not working

Hi:D!

I have been trying to create field link on a form application,
by creating a field and use an onClick ajax event.

But then I found out that the link does not work, the link just don not appear on the form .
(the field not changing to blue and with underlining, and you cant click on it)

Is there any solution to this?

Yes, create a field of type label, and apply the <a href=… text to it.

Thanks for the reply !:wink:

I tried to apply the <a href=“mylink”>link</a> on the field,
but then the form just show <a href=“mylink”>link</a> in plain text.

How can I fix this?

is there any way to make a field link in this case?

Also since the onClick event doesn’t work, is there any way to make a image link in this case?

Did you make the field of type label? (Not the same as having a Text field with “label field” enabled)

Re Image link you can create a field of type HTML Image

yes I made it a field of type label, and if I create a field of type HTML Image, the onClick event just doesn’t work

Okay - need more detail then.

For example, how are you assigning the <a href=“mylink”>link</a> to the label field? Re the Image field, what’s in your onClick event?

I just assign the <a href=http://somewebsite>link</a> to the text at the field setting.
And for the onClick event, I just create it on a random field with sc_redir(“somelink”), and then that field doesn’t appear as a clickable field, just like a normal plain text field.

ad1 is correct, but the field must be of type label, not the label property of type text.
Onclick is an ajax event, so it’s likely that sc_redir which is running at php level doesn’t function as ajax (javascript) is waiting for a response which doesn’t come. But I’ll try it out.

Brian - so if I recreate what you say (see Pic 1 & 2)…

Pic 1

Pic 2

I get…

… which works for me - or have you set it up differently?

I’ll let Albert finish his tryout on the AJAX bit… :slight_smile:

Capture.JPG

Capture2.JPG

Capture3.JPG

Thanks for the reply again;)
I tried to do that in a single record form to recreate the setting above and it works,
but is there anyway to create a similar form of link in multiple records, editable grid or editable grid view?:confused:

Just build the “link” in the onLoadRecord event. This assumes you are pulling data (the link itself, and friendly text) from a table as part of your form’s query (i.e those fields are in the field list, but then marked as hidden):

{link} = '<a href="' . {mylink} . '">' . {linktext} . '</a>';

where {link} is your label field, and {mylink} and {linktext} are hidden fields from your database table.

1 Like

I do apologise to resurrect one and a half year old thread. But this is what I am looking for, Last reply from adz1111 is what I did at the moment, but I encountered problem when adding new record. the link value become broken since it wrapped in a input with type hidden. Can anyone help on this?

My thread question is here http://www.scriptcase.net/forum/forum/scriptcase-8/discussion-aa/62345-links-application-link-in-editable-grid-view-form-application