Announcement

Collapse
No announcement yet.

Field link in form not working

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Brian
    started a topic Field link in form not working

    Field link in form not working

    Hi!

    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?

  • adinugro
    replied
    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/foru...rm-application

    Leave a comment:


  • adz1111
    replied
    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):

    Code:
    {link} = '<a href="' . {mylink} . '">' . {linktext} . '</a>';
    where {link} is your label field, and {mylink} and {linktext} are hidden fields from your database table.

    Leave a comment:


  • Brian
    replied
    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?

    Leave a comment:


  • adz1111
    replied
    Brian - so if I recreate what you say (see Pic 1 & 2).....

    Pic 1
    Capture.JPG

    Pic 2
    Capture2.JPG

    I get.....

    Capture3.JPG

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

    I'll let Albert finish his tryout on the AJAX bit... :-)

    Leave a comment:


  • aducom
    replied
    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.

    Leave a comment:


  • Brian
    replied
    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.

    Leave a comment:


  • adz1111
    replied
    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?

    Leave a comment:


  • Brian
    replied
    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

    Leave a comment:


  • adz1111
    replied
    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

    Leave a comment:


  • Brian
    replied
    Thanks for the reply !

    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?
    Last edited by Brian; 11-06-2014, 01:15 AM.

    Leave a comment:


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

    Leave a comment:

Working...
X