PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > PHP Submit Question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
PHP Submit Question

Réponse
 
LinkBack Outils de la discussion
Vieux 27/04/2008, 00h37   #1
Mtek
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut PHP Submit Question

Hi,

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>

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.

Thank you,

John
  Réponse avec citation
Vieux 27/04/2008, 02h04   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP Submit Question

Mtek wrote:
> Hi,
>
> 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>
>
> 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.
>
> Thank you,
>
> John
>


No idea. You haven't shown us any PHP code.

Or maybe you're in the wrong newsgroup?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 27/04/2008, 09h24   #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
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h03.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11899 seconds with 11 queries