Welcome to WebmasterWorld Guest from 54.145.39.186

Forum Moderators: open

Message Too Old, No Replies

js

Some suggestions on cookie script

     

Birdman

12:00 am on Jul 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Once again, thanks to all of the helpful people here. I will due my duty in the future, when I know enough to answer. Anyway, I'm writing my first cookie script and I'm not that great at JS but I have a decent understanding, I think.

question1 = sending_info_from_form(arguments, or_document.form.name)

Birdman

12:13 am on Jul 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, that was pretty stupid. But seriously, if I'm using a form, should I send the info(from body to function) using arguments or should I get the info by using document.form_name.input_name.value?

rewboss

7:44 am on Jul 25, 2002 (gmt 0)

10+ Year Member



To save typing, use the this keyword. If the <form> tag looks like this:

<form onsubmit="return process(this);">

then the entire form will be passed to the function, which would look like this:

function process(f){
doSomethingWith(f.firstName.value);
// instead of writing
// doSomethingWith(document.form_name.firstName.value);
}

 

Featured Threads

Hot Threads This Week

Hot Threads This Month