Forum Moderators: open
I'm making a form, with text fields that u name as usual. The thing is, when mailed, i do not want the empty textareas listed in the mail... so what function, or better yet... how do i go on about this...?
please reply as soon as possible
/Prozaac
On submitting the form, check whether the value of the textarea is empty. If so, remove the textarea from the DOM with the method removeChild(), so that it cannot be sent to the server. Then proceed with the submission.
It may be easier to handle this server-side, i.e. in the script that handles the mailing.
> please reply as soon as possible
I sincerely hope this was fast enough.
Some pointers: do a Google search for removechild [google.com] and you'll be presented with links to relevant pages in the two main references: the Mozilla DOM (=Document Object Model) reference and the MSDN DHTML reference. I'm sure that if you play for a while with the examples they provide, you'll be able to implement the method into your own script.
There are some nice javascript/form tutorials in this forum's library [webmasterworld.com].
HTH!