switch replace and replaceAll button event