Update other fields on select?

QuestionsUpdate other fields on select?
Gary Brett asked 10 years ago

Hi there, I have a columns on grid called 'Status' and 2 others, called A & B. The status column is a select with A & B the options. If user selects A I would like todays date inserted into A, if they select B again today's date and so on. Is this possible within the grid at all?

Thanks

1 Answers
Abu Ghufran answered 10 years ago

You can bind onclick event of status 'select' input. And in JS callback check the value of dropdown and set the input text field.

$col["editoptions"] = array("onclick" => "update_field(this)");

e.g. (just to give idea)
function update_field(d)
{
if (d.value == 'A') jQuery('#A').val(123);
else jQuery('#B').val(123);
}

#A, #B are input field selector of field with col names A and B.

Your Answer

9 + 1 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?