Command to implement the jQuery attr functionality which will set a single property to a value, on all matched elements.

Example code:

$output[] = ctools_ajax_command_attr(
  'input[name*="[title]"]',
  'value', 
  'New value to set'
);

Will create a ctools ajax command to change the value of every input field with title in its name to "New value to set"

Patch rolled against head.
Comments and suggestions welcome.

CommentFileSizeAuthor
#2 attr_command2-HEAD.patch2.04 KBferdi
attr_command-HEAD.patch1.99 KBnickl

Comments

merlinofchaos’s picture

Status: Needs review » Needs work

Failed to apply, unfortunately.

ferdi’s picture

Status: Needs work » Needs review
StatusFileSize
new2.04 KB

Rerolled the patch ...

merlinofchaos’s picture

Status: Needs review » Fixed

Thanks for the reroll!

Committed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.