homepage Welcome to WebmasterWorld Guest from 54.227.67.175
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
js
Some suggestions on cookie script
Birdman




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

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




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

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




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

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);
}

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved