473,806 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can I disable and enable input type?

idsanjeev
241 New Member
Hi
its urgent
how can enable and desable the input field with condition like
if rs("field")=1 then
desable
elseif re("field")=2 then
enable
end if
and that after chek if the input type is enable then manadatory field can't null
thanks
Jan 12 '08
33 3541
gits
5,390 Recognized Expert Moderator Expert
please explain in detail how the option will get automatically selected? ... in case you do it serverside you have to set the visibility of the input-box accordingly ...

kind regards
Jan 17 '08 #21
idsanjeev
241 New Member
hi gits
i don't know about server side and client side
the main things wants to do when user login then a page is open with option to select item, quantity and submit to create requision for item he can add more then one item in same requision to add one by one so when he selected cd and floppy then show the input field if option is cartidge then hide show i don't know which type of code have to write client side or server side.
Jan 17 '08 #22
gits
5,390 Recognized Expert Moderator Expert
hi ...

please load your page to a browser and view the source-code -> copy that source-code from the browser, save it as a txt-file and post it here or send me a pm with it ... i have to have a closer look at it ...

kind regards
Jan 17 '08 #23
idsanjeev
241 New Member
Hi Gits
Thanks for kind supports i attached here both page where these work is need
Jan 17 '08 #24
gits
5,390 Recognized Expert Moderator Expert
hi ...

you posted the asp-code ... but i wanted to have a look at the page when it is loaded to the browser :) ...

let me give you a working example here that uses the code:

[HTML]<html>
<script type="text/javascript">
function toggle_state(ob j) {
// here we check the value of your select-box
var val = obj.value == 'cartridge';

var input_node = document.getEle mentById('purpo se');

input_node.styl e.visibility = val ? 'hidden' : 'visible';
}
</script>
<body>
<select onchange="toggl e_state(this);" >
<option selected="selec ted" value="">select something</option>
<option value="cartridg e">cartridge </option>
<option value="CD">CD</option>
<option value="floppy"> floppy</option>
</select>
<input type="text" id="purpose" style="visibili ty:hidden;"/>
</body>
</html>
[/HTML]
have a look at it ... the onchange HAS to be added to the select and HASN'T to be added to the option (like in formsan1.txt) ... as far as i could see you preselect an option with no value ... so we could adapt the function then ... and have a look at the input-field ... i hide it initially ... now when you change the selected value we get the input shown in all cases except cartridge ...

kind regards
Jan 17 '08 #25
idsanjeev
241 New Member
hi gits
sorry i have only these two page and one another that is submit requistion and generate report for requestion some other pages thats is departmentwise reports i know that i used it when another page it work fine but in these pages it not work why i don't know so what i have to do
thanks
Jan 17 '08 #26
idsanjeev
241 New Member
Thanks Gits
You are the good guide i find it after long discussion with u
and i am very upsate becouse some confussion in the page that was not develped by me but i have to given this work for midification in the requestion system for restriction .
please if you have time then i know little about server side code and client side code by You. you are best gui.
thanks again
Jan 17 '08 #27
gits
5,390 Recognized Expert Moderator Expert
no problem ... glad to hear you got it working :) ... if you have more questions concerning client- and serverside coding please post a new thread to the forum ...

kind regards
Jan 17 '08 #28
idsanjeev
241 New Member
Hi gits
you know whats is the problems where we are dusscused last time problems is select option is number and i am compairing it with character so this is the region of our long descussion realy i am mad.
sorry again problems in show and hide
problems is when first choosen by user is cartidge and any thing it work fine but addition for next item it not work.and when add button goes to error your case is cd and floppy so please enter purpose that message is report in case of cd and floppy after this message it work again
on the status bar it show error massage and double click on it show detail the error on line 25 object required char=5 code=0
Jan 18 '08 #29
gits
5,390 Recognized Expert Moderator Expert
the add-action submits the form ... is the page reloaded then? ... now i think i would really need a link to a testpage for futher assistence ... i need to see the data-flow and interactions etc. for my own ...

kind regards
Jan 18 '08 #30

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

Similar topics

2
9749
by: HolaGoogle | last post by:
Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another one is "number" field. To display the yes/no field in my asp form i use a checkbox and fot he other field i use a normal text box. if the yes/no field is checked then the other field is enabled otherwise it has to be disabled.Here's what i've done so far: Do While Not ObjRS.EOF <td><input...
2
6474
by: HolaGoogle | last post by:
Can you please tell me the right way to do this?? it's realy important! thanks in advance... Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another one is "number" field. To display the yes/no field in my asp form i use a checkbox and fot he other field i use a normal text box. if the yes/no field is checked then the other field is enabled...
12
8901
by: Forti2ude | last post by:
Hello, I have a simple form... <form> <select name="foo" multiple> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select>
1
2473
by: Manatee | last post by:
Hi group. I have exactly one external, alternate stylesheet that I want to enable or disable by form controls, on one page only (not saved across pages). I used: <link rel="alternate stylesheet" id="style-compact" etc...> <input name="view" type="radio" onclick="document.getElementById('style-compact').disabled=false">
1
4258
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES is selected - enable a field to use the M$ Datepicker. Using the code below works for most of our fields, however the problem is that when the field is re-enabled - it remembers the original date or data prior to it being disabled - despite the...
2
26378
by: Kevin | last post by:
I've been looking all over and I can't seem to find what ought to be simple. I need to disable a drop down when a checkbox is checked, and enable it when same checkbox is unchecked. I've found any number of scripts to disable / enable a drop down but they are all made to work with 2 different buttons, radio group selections, etc. I can't seem to come up with one that can toggle off a single checkbox.
5
14284
by: metalwing12 | last post by:
Hi guys can someone kindly help me about my code it seems incomplete or i just can make it right .I try using the disabled property of the textbox yes it workss, it disable it but when i set it to false like disabled="false" it does not enable the textbox.This is my code <p><input type="text" name="txtbox1" size="20" disabled="true"> <input type="button" value="Click" name="B3" disabled="true"> Operator</p> <p><input...
10
5102
by: viki1967 | last post by:
Disable/enable icon.gif Hi all. I have this form in the page.htm: <form action="form.asp" method="post" onsubmit="return(validateForm(this));"> <select size="1" name="t_im" onchange="Form()">
10
9116
by: sowmyati | last post by:
HI All, I am new to javascript. I have snippet wherein i am giving a brief note on what i am trying to do. In the below have a variable by name stuff. trying to reset the page. Part of the code which does reset is attached below. there is a reset button which will reset the connection and it takes two min for data loading during which the reset button has to be disabled and later after two mins it should enable the button for the user. ...
0
9597
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
10371
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
9187
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
6877
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
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
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
3850
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
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.