Pergunta

We're trying to clear a textarea in a form using jQuery.

It works in Safari and Chrome, but not in Firefox. The problem in FireFox is that it is clearing the text in the source (according to firebug) but not in the normal browser display.

The code we are using is:

$("#text_areas_id").val("");

Is anyone aware of a bug in Firefox 4 with this?

Our guess is that we need to somehow re-render the textarea for firefox after we change its vallue. We read some people had similar problems in Opera and fixed it by setting the css of the text area to display:block, but we didn't have any luck with this.

We are using FireFox 4.01 on Mac & Firebug 1.7.0

Thanks for any assistance you can offer!

Foi útil?

Solução

I have just tried your solution in Firefox 4.0.1 and seems to work: http://jsfiddle.net/8NEzR/8/

Outras dicas

Have you tried using text() instead of val()?

$("#text_areas_id").text("");
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top