Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

live search macro: change button text "go" to "search"

Gustav Stresemann October 11, 2011

I use the Live Search macro in my theme. Is there a simple way to change the button name? I would like to rename the text of the button "go" on "search". Thank you for tips

2 answers

1 accepted

1 vote
Answer accepted
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 11, 2011

Browse to:

Confluence Admin | Look and Feel | Custom HTML 

In At end of the HEAD, add some JavaScript similar to this:

<script>
  AJS.toInit(function(){
    AJS.$('.plugin_livesearch_buttonbox input').val('Search');
  });
</script>

Gustav Stresemann October 12, 2011

Wow, you're my hero! :) It works fantastic and I'm happy. However, I have a question about this script. Why do I have to write "val", instead write "value"? In the tag <input type="submit" value="$action.getText('livesearch.macro.go')"> but is also "value" write and not "val"!?

Thank you!

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 12, 2011

We use .val() because we're using the jQuery method .val() to manipulate the DOM.

0 votes
Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 20, 2012

This is obviously a jQuery specific question, but do you know if you can set the value to an image rather than simple text? For example, a magnifying glass image?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events