473,675 Members | 3,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Highlight a text field when respective radio button is clicked

1 New Member
Hie..I am working asp page with java script as script language. In a form, I have two radio buttons stating active or inactive. I have two text fields next to radio buttons containing Date activated and Date released (for inactive)
Now , I want the text field to be highlighted only when user selects respective button.
Eg.. If user selects active, I want Date activated text field to be highlighted automatically and if user selects inactive, Date released text field must be highlighted
This is a part of my code containing radio buttons with normal textfields date activated and date released

<%@ LANGUAGE="JAVAS CRIPT" %>
<!-- #include virtual="/header.asp" -->
<%
/**
* file: application/inventory/add.asp
* description: allow users to add a new vehicle to the DB
**/
%>
<script language="javas cript">

</script>
<%

// the form
Response.Write( "<form action='add.asp ' method='POST' onsubmit='retur n checkForm()' name='myform'>" );


// Radio button control
Response.Write( "<tr class='d0'><td> Status</strong></td><td>Active: <input type='radio' name='status' value='1' />&nbsp; &nbsp; Inactive: <input type='radio' name='status' value='0' /></td><tr>");
Response.Write( "<tr class='d0'><td> Date Activated</strong></td><td><input name='Dateactiv ated' type='text' /></td></tr>");
Response.Write( "<tr class='d0'><td> Date Released</strong></td><td><input name='Daterelea sed' type='text' /></td></tr>");

Response.Write( "<input type='submit' value='Submit' />");
Response.Write( "<input type='reset' value='Reset' />");
Response.Write( "<input type='button' value='Cancel' onclick='window .location=\"sea rch.asp\"' />");
Response.Write( "</form");
%>

<!-- #include virtual="/footer.asp" -->

I really appreciate your help...:)
Mar 15 '12 #1
0 1972

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

Similar topics

1
1457
by: Frank | last post by:
Hi, I want to create two radio button Yes and No. Only on select that radio button 'Yes', the text field should get enabled. How to do this? Thanks.
3
3272
by: Claire Osborne | last post by:
I have created a form at http://www.habitatforhumanity.org.uk/html/gv_indiv_apply.htm In the Medical Details section we need to ensure that if a radio button is clicked to indicate a health issue then the textarea box is filled in. Is there a way to do this? I am not an expert in Javascript so please treat me as stupid!
2
2958
by: Bart Verbeke | last post by:
Hi, I have a form with 2 radio buttons (ACCEPT/REJECT). When the page is initially loaded, no textbox should be visible. When a user clicks the REJECT radio button, a textbox should automatically appear below the radiobutton where the user can motivate why he chose the reject option (which we require). When the user clicks the ACCEPT radio button, the textbox should not
0
1157
by: djjohnst | last post by:
I am creating a form(survey) where the first question is a yes/no question using two radio buttons. If they click "yes" I want to then make the next 4 questions required. I am not sure how to do this. I thought I could use a custom validator, and using code behind use an IF statement. However, I am not sure how to pass the value from the radio button group. I am having trouble. If this is easy forgive me, I am new at this .net game.
3
7061
by: RogerInHawaii | last post by:
I want to effectively do a Post type submit to the very same page when the user clicks on a particular radio button. Of course, I also want it to recognize the click (i.e. checkmarking the radio button) first so the new status of that readio button gets properly Posted. How do I do that?
10
3407
by: mukeshrasm | last post by:
Hi I have a html in which there is two selection box and two radio button. Radio buttion is of array type. What I want if user will click the radio button then only he/she be able to make selection from select list. Initially I tried to disble the selection control. And when user will click the radio then only it was enabled. but I faced problem that value is not passed to the next form of the select list. so I enable the select list now...
3
4646
paulrajj
by: paulrajj | last post by:
hi to all, How to Enable a text field only on selecting a radio button using only getElementById..
4
2371
by: januincse | last post by:
There 2 radio buttons.when a radio is clicked textbox should appear,when another radio clicked the existing textbox should disappear and new textbox should be enabled.
1
2425
by: thelouvre | last post by:
I have a little program here that I think would simulate something close to what I'm trying to do. I'm assuming if I can make it work, I can get the big stuff to work. I have a form, that basically allows you to select a radio button. When the button is pressed, I want to preload my date field text boxes. But their values are staying blanked out when I go and populate the page. So I tried to write a very small program included here that...
2
2216
by: lonelylonely | last post by:
how to display in new text field when i add option from drop down list?
0
8973
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8869
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...
0
8722
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7503
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
6380
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
4261
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
4468
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2868
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
2127
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.