473,326 Members | 2,182 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,326 software developers and data experts.

PHP & Javascript insanity

So, I've been fighting with this for a day now and would love some help.

I am working on:
http://www.webaccessstrategies.com/c...enewalform.php
Because of the size of the form, users have been getting a bit trigger-
happy on the submit button.

I've found a method to disable the submit button, but now I have a problem
with my server-side validation.

The form submits to itself to do validation based on whether or not
$_REQUEST['submit'] isset.

The problem is that now that I have the javascript in place to disable the
button, $_REQUEST['submit'] is never getting set.

TIA for any guidance on what is causing this.

--
Karl Groves
http://karlcore.com
http://chevelle.karlcore.com
Apr 12 '06 #1
11 1501
On 12/04/2006 14:54, Karl Groves wrote:
I am working on:
http://www.webaccessstrategies.com/c...enewalform.php
Because of the size of the form, users have been getting a bit trigger-
happy on the submit button.
I'm not surprised. It's enormous! The first thing I'd suggest is
breaking it down into sections, and allow the user to move between them.
With a form that large, it might also be beneficial to allow the user to
save it in a partial state then log back in to resume at a later date.
I've found a method to disable the submit button, [...]
I suggest that you lose it again: it's not good for usability. Consider
what happens if the user has problems submitting and hits the back
button to try again. How do you propose they resubmit?

[snip]
The problem is that now that I have the javascript in place to disable the
button, $_REQUEST['submit'] is never getting set.


Disabled form controls are not successful; they don't become part of the
form data set.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Apr 12 '06 #2
El Wed, 12 Apr 2006 08:54:03 -0500
Karl escribió:
The form submits to itself to do validation based on whether or not
$_REQUEST['submit'] isset.


well, you could just add a hidden field and check for it instead.

<input type="hidden" id="issubmiting" value="1"/>

and then in your code

if(isset($_POST['issubmiting'])&&$_POST['issubmiting']=='1')
{
//process the form
}

--
Juan José Gutiérrez de Quevedo
Director Técnico (ju****@iteisa.com)
ITEISA (http://www.iteisa.com)
942544036 - 637447953
Apr 12 '06 #3
Michael Winter <m.******@blueyonder.co.uk> wrote in
news:fV*****************@text.news.blueyonder.co.u k:
On 12/04/2006 14:54, Karl Groves wrote:

The problem is that now that I have the javascript in place to
disable the button, $_REQUEST['submit'] is never getting set.


Disabled form controls are not successful; they don't become part of
the form data set.


Ah, OK. So by disabling it, no value is passed. Dur. I should have known
better. Thanks for the response!
--
Karl Groves
http://karlcore.com
http://chevelle.karlcore.com

Accessibility Discussion List: http://smallerurl.com/?id=6p764du
Apr 12 '06 #4
Wow, i strongly recommend you asses what questions on that form
logically fit together and break it up into multiple pages. If i were
filling that out im pretty sure id go crazy. Even if it takes just as
long, having more susinct things can help usability.

Apr 12 '06 #5
Also, if this form is a renewal form for existing clients, why are you
having them re-enter all their information? Shouldn't you just show
them the information you have on file and ask for a confirmation?

I'd really hate to have to fill out this entire form every six months
when the only piece of information that has changed was my
symtoms/illness.

Also, consider client-side validation via jscript to compliment the
serverside validation.

-Robert

Apr 12 '06 #6
"Areric" <jo**********@gmail.com> wrote in news:1144851661.619216.39750
@u72g2000cwu.googlegroups.com:
Wow, i strongly recommend you asses what questions on that form
logically fit together and break it up into multiple pages. If i were
filling that out im pretty sure id go crazy. Even if it takes just as
long, having more susinct things can help usability.


I've already "strongly recommended it" to the client. They didn't want to
hear it.

--
Karl Groves
http://karlcore.com
http://chevelle.karlcore.com

Accessibility Discussion List: http://smallerurl.com/?id=6p764du
Apr 12 '06 #7
"rlee0001" <ro*********@hotmail.com> wrote in news:1144852867.175801.148370
@i39g2000cwa.googlegroups.com:
Also, if this form is a renewal form for existing clients, why are you
having them re-enter all their information? Shouldn't you just show
them the information you have on file and ask for a confirmation?

I'd really hate to have to fill out this entire form every six months
when the only piece of information that has changed was my
symtoms/illness.


Client required it.
There's only so many times you can say "I don't really think that's a good
idea", before you just throw your hands up and do what they ask.

--
Karl Groves
http://karlcore.com
http://chevelle.karlcore.com
Apr 12 '06 #8
Here's how I disable a button on submit

<input type="submit" onclick="PleaseWait(this)" />

the javascript is

function PleaseWait(button)
{
button.value='PLEASE WAIT';
button.style.color='red';
button.onclick= function() {
alert('Please Wait');
return false;
}
return true;
}

We also do server side checking for duplicate form posts on all forms
received.

Apr 13 '06 #9
fletch wrote:
Here's how I disable a button on submit

<input type="submit" onclick="PleaseWait(this)" />

the javascript is

function PleaseWait(button)
{
button.value='PLEASE WAIT';
button.style.color='red';
button.onclick= function() {
alert('Please Wait');
return false;
}
return true;
}

We also do server side checking for duplicate form posts on all forms
received.


You can't unless you send the page back to the client. Javascript is
client-side, while PHP is server-side.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 13 '06 #10
Well, I do.

(client) form -> *submit* -> submit button disabled -> (server now)
form compared to previous forms -> form validated -> form saved to
session -> form processed or represented to user to fix (client again).
Javascript is client-side, while PHP is server-side.


yup.

Apr 13 '06 #11
An easy method of accomplishing this would be to have a hidden field
with the submit value and leave the button unnamed.

Apr 13 '06 #12

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

Similar topics

12
by: Mike Dee | last post by:
A very very basic UTF-8 question that's driving me nuts: If I have this in the beginning of my Python script in Linux: #!/usr/bin/env python # -*- coding: UTF-8 -*- should I - or should I...
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
5
by: Tim Marshall | last post by:
In a recent review of someone's web site on a hobby forum, one poster mentioned the difficulties for folks with some forms of colour blindness to see some of the text of the web site in question. ...
115
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical...
8
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
19
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - I have <a href="javascript:somefunction()"what ... ?...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.