I have a drop down box with 'Incomplete', 'Resolved' and 'Complete' as
part of my $status variable on a form and a text box called
'$datecomp' that passes the data from both variables to a MySQL
database.
How might I include an 'if' statement where if the drop down selection
for variable $datecomp is 'Incomplete' or 'Resolved', an error message
is displayed on the data entry confirmation page that requests the
user to click their browser 'back' button and enter a date in the
'datecomp' field? I was trying to modify the following code but so
far, without any luck. In other words, if 'status' = Complete or
Resolved, trigger the error on the confirmation page where a user
clicks their back button and either enters a date in the datecomp
field OR leaves the drop down box as Incomplete.
thanks,
John
if (!$datecomp || and $status="Complete" or "Resolved")
{
echo 'You must enter a DATE for items marked Complete or
Resolved.<br />'
.'Please click the browser BACK button, fill in a Complete/
Resolved date and try again.';
exit;
} 4 1440
On Jun 13, 7:23 pm, j...@lycos.com wrote:
I have a drop down box with 'Incomplete', 'Resolved' and 'Complete' as
part of my $status variable on a form and a text box called
'$datecomp' that passes the data from both variables to a MySQL
database.
How might I include an 'if' statement where if the drop down selection
for variable $datecomp is 'Incomplete' or 'Resolved', an error message
is displayed on the data entry confirmation page that requests the
user to click their browser 'back' button and enter a date in the
'datecomp' field? I was trying to modify the following code but so
far, without any luck. In other words, if 'status' = Complete or
Resolved, trigger the error on the confirmation page where a user
clicks their back button and either enters a date in the datecomp
field OR leaves the drop down box as Incomplete.
thanks,
John
if (!$datecomp || and $status="Complete" or "Resolved")
{
echo 'You must enter a DATE for items marked Complete or
Resolved.<br />'
.'Please click the browser BACK button, fill in a Complete/
Resolved date and try again.';
exit;
}
Solved this puzzle (though it may not be the best example of code
writing) and thought I'd put the solution here in hopes of helping
someone else in a similar bind.. :-)
if ((($status == "Complete") or ($status == "Resolved") and ($datecomp
== "")))
{
echo 'All items marked COMPLETE or RESOLVED must have a date
entered.<br />'
.'Please click the browser BACK button, fill in the date and
try again.';
exit;
} jc***@lycos.com wrote:
I have a drop down box with 'Incomplete', 'Resolved' and 'Complete' as
part of my $status variable on a form and a text box called
'$datecomp' that passes the data from both variables to a MySQL
database.
How might I include an 'if' statement where if the drop down selection
for variable $datecomp is 'Incomplete' or 'Resolved', an error message
is displayed on the data entry confirmation page that requests the
user to click their browser 'back' button and enter a date in the
'datecomp' field? I was trying to modify the following code but so
far, without any luck. In other words, if 'status' = Complete or
Resolved, trigger the error on the confirmation page where a user
clicks their back button and either enters a date in the datecomp
field OR leaves the drop down box as Incomplete.
thanks,
John
if (!$datecomp || and $status="Complete" or "Resolved")
{
echo 'You must enter a DATE for items marked Complete or
Resolved.<br />'
.'Please click the browser BACK button, fill in a Complete/
Resolved date and try again.';
exit;
}
if (!$datecomp && ($status == 'Complete' || $status == 'Resolved'))
....use '=' for assignment and '==' for comparison.
Norm
>I have a drop down box with 'Incomplete', 'Resolved' and 'Complete' as
>part of my $status variable on a form and a text box called '$datecomp' that passes the data from both variables to a MySQL database.
The variable passed to PHP is $_GET['datecomp'] or $_POST['datecomp'],
not $datecomp. (register_globals is evil and should be turned off).
>How might I include an 'if' statement where if the drop down selection for variable $datecomp is 'Incomplete' or 'Resolved', an error message is displayed on the data entry confirmation page that requests the user to click their browser 'back' button and enter a date in the 'datecomp' field? I was trying to modify the following code but so far, without any luck. In other words, if 'status' = Complete or Resolved, trigger the error on the confirmation page where a user clicks their back button and either enters a date in the datecomp field OR leaves the drop down box as Incomplete.
There's no meaning to a subexpression like: "Complete" or "Resolved".
Think of it as: If status is Complete or status is Resolved, then ....
>thanks, John
if (!$datecomp || and $status="Complete" or "Resolved")
if (isset($_GET['datecomp'] && ($_GET['status'] == "Complete" || $_GET['status'] == "Resolved"))
{
echo 'You must enter a DATE for items marked Complete or Resolved.<br />'
.'Please click the browser BACK button, fill in a Complete/ Resolved date and try again.';
exit;
}
On Jun 13, 9:04 pm, gordonb.ic...@burditt.org (Gordon Burditt) wrote:
I have a drop down box with 'Incomplete', 'Resolved' and 'Complete' as
part of my $status variable on a form and a text box called
'$datecomp' that passes the data from both variables to a MySQL
database.
The variable passed to PHP is $_GET['datecomp'] or $_POST['datecomp'],
not $datecomp. (register_globals is evil and should be turned off).
How might I include an 'if' statement where if the drop down selection
for variable $datecomp is 'Incomplete' or 'Resolved', an error message
is displayed on the data entry confirmation page that requests the
user to click their browser 'back' button and enter a date in the
'datecomp' field? I was trying to modify the following code but so
far, without any luck. In other words, if 'status' = Complete or
Resolved, trigger the error on the confirmation page where a user
clicks their back button and either enters a date in the datecomp
field OR leaves the drop down box as Incomplete.
There's no meaning to a subexpression like: "Complete" or "Resolved".
Think of it as: If status is Complete or status is Resolved, then ....
thanks,
John
if (!$datecomp || and $status="Complete" or "Resolved")
if (isset($_GET['datecomp'] && ($_GET['status'] == "Complete" || $_GET['status'] == "Resolved"))
{
echo 'You must enter a DATE for items marked Complete or
Resolved.<br />'
.'Please click the browser BACK button, fill in a Complete/
Resolved date and try again.';
exit;
}
Thanks very much for your help guys - appreciate it! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: |
last post by:
Hi,
I am an intermediate computer science student and I am in need of a "macro
type" tool/language that will let me automate a data entry process. The
data entry is rather simple but requires...
|
by: Iain Miller |
last post by:
Struggling a bit here & would be grateful for any help.
I have a table which has a list of people in it. Each person has a unique ID
automatically allocated by Access but also belongs to one of 5...
|
by: Nancy |
last post by:
I have two tables:
TblCourse
CourseID
CourseName
TblClass
ClassID
CourseID
ClassDate
|
by: tamilan71 |
last post by:
Can anyone tell me a simple method of creating an application in Access
2003 that uses "Double data entry"? For me double data entry is defined
as the ability to have data entered twice. The first...
|
by: filbennett |
last post by:
Hi Everyone,
I'm generally unfamiliar with Access form design, but have programmed
Cold Fusion applications for a couple of years.
I'd like to build a data entry form in Access that allows the...
|
by: hippomedon |
last post by:
Hello everyone,
I'm looking for some advice on whether I should break the
normalization rule. Normally, I would not consider it, but this seems
to be a special case.
I have created an...
|
by: admin.offshoredataentry |
last post by:
Data Entry Outsourcing provides time bound, cost effective and
qualitative Data Entry also provides numeric data entry, textual
data entry, image data entry, data format, data conversion and also...
|
by: Data Entry Outsourcing |
last post by:
Data Entry plays vital role in every business area. Data Entry is one
such aspects of any business that needs to be handled properly for
expanding your business. Data Entry is one of the leading...
|
by: dataentryoffshore |
last post by:
Get a Discount up to 60% on data entry, data capture, dataentry
services, large volume data processing and data conversion services
through offshore facilities in India. Offshore data entry also...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| | |