PDA

View Full Version : Clear Textfield in different frame


CalypsoClub
07-25-2003, 04:50 PM
Hi!

I have an Inline frame for a chat system. Everytime I hit send, the inline frame gets refreshed and shows the new line of text. This is done with PHP.

What I want now is to clear the messagebox after the content has been sent to the inline frame.

How do I do that?

Thanks!

cheesebagpipe
07-25-2003, 05:19 PM
Use PHP to echo into the iframe's HTML something like:

<script type="text/javascript">

parent.document.form_name.textarea_name.value = '';
parent.document.form_name.textarea_name.focus();

</script>

That last is optional, natch.

CalypsoClub
07-25-2003, 07:30 PM
Thank you very much!

It works like a charm!