473,788 Members | 3,078 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="#00FF0 0"><a
href="savedata. php" onclick="if ('preventDefaul t' in event)
{ event.preventDe fault(); }
else { event.returnVal ue = 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
('preventDefaul t' in event) { event.preventDe fault(); } else
{ event.returnVal ue = 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 1428
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="#00FF0 0"><a
href="savedata. php" onclick="if ('preventDefaul t' in event)
{ event.preventDe fault(); }
else { event.returnVal ue = 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
('preventDefaul t' in event) { event.preventDe fault(); } else
{ event.returnVal ue = 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*******@attgl obal.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="#00FF0 0"><a
href="savedata .php" onclick="if ('preventDefaul t' in event)
{ event.preventDe fault(); }
else { event.returnVal ue = 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
('preventDefau lt' in event) { event.preventDe fault(); } else
{ event.returnVal ue = 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
17858
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 has not yet click the submit button to submit the form, the system need to automatically submit it. So, can anyone teach me how to check the time out as well as how to make the form submit automatically? Thank you very much.
6
11400
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 4.5 and a good deal of the page processing depends on whether or not a control is defined. To prevent users from clicking on a submit button more than once or clicking on another submit button before the page has finished processing I have...
6
3106
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 should be submitted as if the button is pressed. Is this correct? Does this behaviour vary across browsers? Chris
4
4134
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 finding the answer in previous posts - I have already seen this question answered numerous times in this forum, only problem is that the recommended method is not available to me :-(. I know that if I could code an onclick event on the <input...
6
2749
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 fine.... except that the element MYBUTTON must exist as a hidden field.
4
4940
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 what I'd like to have happen :
5
3463
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 be submitted, but it isn't for some weird reason. However, after I press the ok button, it submits the form, and then the combo boxes start working normally. In IE, everything works fine. I appreciate any help. Thank you. <html>
26
2918
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, x2, x3. I have no clue how to do this with a link submit. Thanks,
7
2366
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, because the <FORM ACTION="... tag seems to make sure that any two submit controls in a form have to go to the same target. BTW, the CANCEL button does not have to submit any form data.
4
4355
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 fields and submit the form on another window. Regards, Michael
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10172
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.