Forum Moderators: open

Message Too Old, No Replies

Forms

         

prozaac

10:10 am on Jul 27, 2004 (gmt 0)

10+ Year Member



Hi all,got a problem that i've not been able to solve.
Hopefully with your expertice, it'll be over soon.

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

RonPK

12:42 pm on Jul 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello 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.

prozaac

1:35 pm on Jul 27, 2004 (gmt 0)

10+ Year Member



hmm, could you be a little more precise...plz =)

i'd be really happy if you could give me some sort of example to use...(i'm not using php,asp) just simple html with javascript tags...

/Prozaac

RonPK

2:05 pm on Jul 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Come on prozaac, 'please write my script' is not the idea of this board.

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!

prozaac

2:08 pm on Jul 27, 2004 (gmt 0)

10+ Year Member



Great! thx for your help. was unfamiliar with the DOM term... been working with nodes n stuff, but i thought that was pure java and couldn't be implemented...

i'm sure i'll work it out!

/Prozaac

RonPK

8:48 pm on Jul 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just in case someone finds this thread while searching the web: Prozaac decided to continue elsewhere, first here [webmasterworld.com] and a few hours later here [webmasterworld.com].