|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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 ================== |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
..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 |
|
![]() |
| Outils de la discussion | |
|
|