Re: Passing variable...
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Passing variable...

From: <alexey@shtokalo.net>
Date: Mon Jan 23 2006 - 13:51:47 CET

You can pass the reference to your form object with using 'this'
statement, e.g.

onSubmit="return verify_form(this)"
...
function verify_form(objForm)

or search for the form object in you function:

var objForm = document.getElementById("dane");

but in this case you should also expand form tag with option id="dane".

In any way usage of the object identical for both cases:

alert('Family_name value is ' + objForm.family_name.value);

To check that radio button were choosen:

<input type="radio" name="radio_button_name">Top
<input type="radio" name="radio_button_name">Middle
<input type="radio" name="radio_button_name">Bottom

use followin code:

if (objForm.radio_button_name[0].checked ||
objForm.radio_button_name[1].checked ||
objForm.radio_button_name[2].checked)
{
alert('Some option were choosen!');
}

P.S. You can get complete help for DOM and JavaScript usage in MSDN.
Received on Tue Feb 7 21:19:02 2006