Discussion: PHP Submit Question
Afficher un message
Vieux 27/04/2008, 10h24   #3
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP Submit Question

..oO(Mtek)

>In the PHP form for my company, they use an image button to submit the
>form to some javascript for validation, then use the SUBMIT() to
>submit the form. The code is this:
>
> <TD class="topnav" bgcolor="#00FF00"><a
>href="savedata.php" onclick="if ('preventDefault' in event)
> { event.preventDefault(); }
> else { event.returnValue = false; }
> formvalidation(document.forms['Add_Data']);">SAVE DATA</
>a></TD>


Ugly. What happens without JavaScript?

>Now, they have changed the site and rather than using an image button,
>they are using some CSS to use a position on the background to kick
>off the submit process. The code is similar to above:
>
> <div class="nextimg">
> <a id="nextlink" href="savedata.php" onclick="if
>('preventDefault' in event) { event.preventDefault(); } else
>{ event.returnValue = false; }
>formvalidation(document.forms['Add_Data']);"></a>
> </div>
>
>The problem is that whe it hits the SUBMIT() command, it gives an
>'object expected' error.
>
>Any or thoughts? This is the way they want it, so this is what I
>have to do. So, if anyone can me work with this, I'd really
>appreciate it.


That's more a JS question and has nothing to do with PHP. Additionally
it's not what I call a proper and reliable form submission method. Forms
are submitted with a button, not with a link. And validation is done on
the server, not (at least not only) on the client.

Micha
  Réponse avec citation
 
Page generated in 0,04868 seconds with 9 queries