Form. Ajax event on_click on user field

Dear friends,

I have a mysql db with a table with two fields: ?id? and ?nombre?.

I define a form type editable-grid. I add a user field ?imagen?.

This ‘imagen’ is a HTML image type field (an icon, in fact).
If I try to define an Ajax event on_click on it, (i.e. to display a message), as I did with a grid application, I can?t select user?s fields but only table fields.

In fact, I could add ‘Imagen’ user field and use ‘edit link’ to call a blank app and do things but I think this is a dirty way for doing things.

Is this a bug on SC?

No, this works as designed. I made a feature request regarding this half a year ago.

Hi Albert,

I just imagine it. Thank you very mach anyway.

JM

Hello,

Issue reported to our bugs team.

regards,
Bernhard Bernsmann

I have the same problem, I need to do something similar, except that when given click this field, I need to validate an information, as you can resolve this?

Hi,
this might be a workaround.
Create a field of type Text.
Define a css-button in ScriptInit: (it just looks better)
print ("<style type=‘text/css’>.mybtn
{
color: #FFFFFF;
border: 1px solid #FFFFFF;
font-weight: bold;
background: #45779A;
height: 30px;
}

.mybtn:hover
{
cursor: pointer;
background: #558ab3;
}
</style>");

In the OnLoad section:
{your_field} = “<button class=‘mybtn’ onclick='your_javascript_method()'type=‘button’>Click Me</button>”;

In ‘your_javascript_method’ do the necessary operations.

Hope this helps
jsb