Skip to content Skip to sidebar Skip to footer

X-webkit-speech: Onwebkitspeechchange Is Not Reseting The Value

I'm trying to reset my input value with onwebkitspeechchange event so that only speech text remains in value. onclick on little mic removed the text after click dialog pop up and

Solution 1:

I ran into the same problem and got it working with a simple JS function. Here's my solution:

<inputx-webkit-speech="x-webkit-speech"onwebkitspeechchange="webkitSpeechChange(this);"name="myinput"value="<?phpecho$this->__('Search entire store here...') ?>"class="search-query" /><scripttype="text/javascript">//<![CDATA[functionwebkitSpeechChange(input) {
        input.value = input.value.replace('<?phpecho$this->__('Search entire store here...') ?>', '');
    }
    //]]>
</script>

where <?php echo $this->__('Search entire store here...') ?> should be your default value.

Hope this helps :)

Post a Comment for "X-webkit-speech: Onwebkitspeechchange Is Not Reseting The Value"