Page 1 of 1

IDs & NAMEs

Posted: Sat Jan 25, 2003 3:17 pm
by Gen-ik
Could someone please explain what difference JavaScript sees between ID and NAME tags.

example: <div id="thediv" name="bob">

Thanks.

Posted: Sun Jan 26, 2003 12:37 am
by volka

Posted: Mon Jan 27, 2003 1:41 am
by pistolfire99
My suggestion, always use ID tags in ur forms if u are going to use php + javascript + html. Without ID's, it was just like hell to pass variables between pages for me...
Oh well...

Posted: Mon Jan 27, 2003 3:58 am
by volka
:?: I doubt the value of an element without name is transmitted.

Code: Select all

<html><body>
<pre><?php print_r($_POST); ?></pre>

<form method="POST">
	<input type="input" name="withName" />:name only<br />
	<input type="input" id="onlyId" />:id only<br />
	<input type="input" name="theName" id="theId"/>: name & id<br />
	<input type="submit" />
</form>
</body></html>
But probably I misunderstood something ;)