473,395 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 help or thoughts? This is the way they want it, so this is what I
have to do. So, if anyone can help me work with this, I'd really
appreciate it.

Thank you,

John
Jun 2 '08 #1
2 1413
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 help or thoughts? This is the way they want it, so this is what I
have to do. So, if anyone can help 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.
js*******@attglobal.net
==================

Jun 2 '08 #2
..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 help or thoughts? This is the way they want it, so this is what I
have to do. So, if anyone can help 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
Jun 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: shake | last post by:
I have to develop an application sounds like this:- User is allow to access a form (is actually a test/quiz) within a specific time frame, let say 45 minutes. After this 45 minutes, if the user...
6
by: JSjones | last post by:
Hi all, I'm new to these boards and my javascript experience is fairly limited and basic so please bear with me. Anyway, on to the question and some background. I'm developing using ColdFusion...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
4
by: actionwoman63 | last post by:
Dear all I need to be able to check which one out of two submit buttons within the same form was pressed in a javascript function prior to form submission. And before I get flamed for not...
6
by: charlie_M | last post by:
I figured out via various help from this forum... EXAMPLE: onClick="document.forms.MYBUTTON.value='SIMPLE';document.forms.submit()" In my CGI I see "MYBUTTON" = "SIMPLE" and this works...
4
by: gimme_this_gimme_that | last post by:
Hi, This is sort of a : How to build a Yes/No dialog box qquestion. Or perhaps a question about getting javascript variables from a pop-up window and processing them on a submit. This is...
5
by: Pascal Batzli Jr | last post by:
Hello, I have a strange situation happening on the code below. When I first load the page, as I change any of the three combo boxes I have created, the onchange event is fired and the form should...
26
by: Mica Cooper | last post by:
Hi, I need to pass some info in a javascript submit. <a href="javascript:document.formName.submit();">Submit Form</a> Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1,...
7
by: David T. Ashley | last post by:
Hi, For a web page, I want a SUBMIT button that commits the form data and a CANCEL button that goes to a different target (i.e. a different script). I haven't figured out how to do this,...
4
by: MichaelK | last post by:
Hello. I have all data already collected on the current page? I want to open another window with the form, fill the fields and submit that form. So basically the question is how can I fill all...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.