Click to See Complete Forum and Search --> : function undefined?


victorym
06-28-2006, 03:16 PM
I have a form with 25 entries. Upon completion, I'd like for the information to go to its database.
In the <head> section I have:
<script language="php" type="text/php">
function DJS_AddPlayer() {
which is supposed to insert the info into the database.
In the <body> there is:
onClick="DJS_AddPlayer"
What I get when I click that button is that DJS_AddPlayer is undefined.
Does onClick only work with JS?

Suggestions??

KDLA
06-28-2006, 03:46 PM
Shouldn't it be onSubmit?

victorym
06-29-2006, 12:51 PM
KDLA,
onSubmit? I'm not familiar with that. Is it the same as the submit button?
I would need the particulars on how it works, if you please. BTW, I don't know the particulars for the submit button, either. *looks embarrassed*

I'm using buttons. One for reset (which works fine), one for adding players and then add more players, one for add this player and stop adding players, one for don't add this player and discontinue (which works, also).

Along those lines, I need to have a series of events happen. Hence the function. See what I mean?

KDLA
06-29-2006, 12:58 PM
Yeah. I just thought that when you're using a form with a submit button, the (following) action must be dependent upon an onSubmit event, rather than onClick.

I'm not a PHP programmer, but have noticed this in forms I've worked with. Don't take my word as the definitive answer.

victorym
06-29-2006, 01:12 PM
Thank you, KDLA. :D