473,782 Members | 2,396 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disabling an input when certain criteria are met.

22 New Member
hello friends,
i m working in php .i wsnt to know about feild validations .As i want to select data from combobox .according to that selected data feilds is to be editable Say for example :
In combobox three values r to be filled .
first name.
last name
age
Now if we select first name then age & lastname feild should be disable.
only firstname feild should be enable.
similarly for two feilds.
As we enter the value in respective feilds and search it it shows the complete data.respect to that feilds where we enter the data.
As i m new fo php please tell me how i validatde the feilds.
thanks
punit
Jul 24 '07 #1
2 1305
pbmods
5,821 Recognized Expert Expert
Heya, Punit.

I'm going to go ahead and move this thread to the JavaScript forum, where one of our resident Experts will be more likely to be able to help you out.
Jul 24 '07 #2
epots9
1,351 Recognized Expert Top Contributor
hello friends,
i m working in php .i wsnt to know about feild validations .As i want to select data from combobox .according to that selected data feilds is to be editable Say for example :
In combobox three values r to be filled .
first name.
last name
age
Now if we select first name then age & lastname feild should be disable.
only firstname feild should be enable.
similarly for two feilds.
As we enter the value in respective feilds and search it it shows the complete data.respect to that feilds where we enter the data.
As i m new fo php please tell me how i validatde the feilds.
thanks
punit
well u can do it in php, but a better way would be to use javascript.

to the drop down list add the attribute 'onchange', like this:
[html]
<select id="list" onchange="myFun ction(this.sele ctedIndex);">
<!--options-->
</select>
[/html]

in the javascript it would be

Expand|Select|Wrap|Line Numbers
  1. function myFunction(ddl)
  2. {
  3. //first option in drop down list "firstname"
  4. if(ddl == 0)
  5. {
  6. //enable
  7. //disable lastname, age
  8. }
  9. //lastname
  10. else if(ddl == 1)
  11. {
  12. //enable lastname
  13. //diable firstname, age
  14. }
  15. //nothing else, so its "age"
  16. else
  17. {
  18. //enable age
  19. //disable firstname, lastname
  20. }
  21. }
  22.  
try that out

good luck
Jul 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2183
by: PerryC | last post by:
Is there a way to set a certain format under the Query Criteria for input? i.e.: As user type 200000000, 200-00-0000 is displayed in the query input box. However, 20000000 is the actual value querried. I am not sure if I make myself clear or not. Thanks in advance. Sincerely, Perry
1
4207
by: Steve | last post by:
I am using Access 2000 and I have a DB that is currently running four different queries from some Forms and subforms. These queries each have a date field that are seperate from each other that are from those said forms. Currently I have setup the criteria for these queries to prompt a user to enter a month # Query Field: Month() Criteria:
1
2624
by: Evelyne | last post by:
I create CheckBoxes on the fly. I want to disable the CheckBoxes when they reflect Status, so the operator does not try to input anything. However, the text/label of the CheckBox gets grayed out also. How can I keep the text/label black (not grayed out) while disabling the input?
4
2265
by: louise raisbeck | last post by:
Hi there, I have put some web controls, textboxes and drop down lists, in a Panel, so that under a certain condition i can disable all fields for input. I read in Help that disabling a Panel control (enabled=false) will disable all child controls within it - just what i want. but it just doesnt work. panMyPanel.Enabled=false; does absolutely nothing. panMyPanel.Visible=false does hide the whole section, so i know i'm referencing it...
3
1522
by: UJ | last post by:
I am going to write a class that will inherit from SqlCommand and I want to disable certain routines in the SqlCommand and add a couple of new routines. How would I go about doing that? I understand (I think) the inheritance process but I'm worried more about the disabling of the routines. I want to disable certain routines and add my own to do some special things. Thanks for the help. Jeff.
1
2810
by: kebabkongen | last post by:
Hi, I'm working on a JavaScript that is enabling / disabling a select element according to whether a checkbox is selected or not. This works fine in Firefox, but in Internet Explorer (v 6.0.2900) it appears wierd: When I disable the selevt element in IE, it continues to appear as enabled (falsely) until I try changing it. When I click on it, updates itself as grey as to indicate that it is disabled.
7
1652
by: PRESENT321 | last post by:
I have a form that appears several times on a page, and would rather not assign IDs. Is there a way to have my validation function focus() a text input without IDs? www.osbornewood.com Search form in the upper right corner. Thanks, Matthew
11
2241
by: shankwheat | last post by:
I have a function which passes text from txtdebt to debtsbox which works fine. However, I want to add code which examines the value of debtsbox and if any of the values the user entered contain the string "d" then I want to emable rblDebts which is disabled when the page loads. This part is not working (no errors) and I'm not sure why. Thanks. <script type="text/javascript" language="JavaScript"> <!-- Begin oldvalue = "";
3
1812
by: PowerLifter1450 | last post by:
Hi all, I have a form that shows student information (primary key = student ID). I have buttons on this form to bring up other forms that can be used to register student for certain events. The first form is data from a student table, while the ones for registering the student are connected to a table s called Students Registered for an event (primary key = Student ID + Event ID). The problem is, then when you open the registration form,...
3
5191
by: Jim Armstrong | last post by:
Hello all - This is driving me crazy. I have a table called tblClients - very simple, has the following fields: taxID (PK) ClientName SalesName The main form of my application allows a user to select a client and
0
9641
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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,...
1
10080
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
8968
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...
1
7494
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
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.