By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,162 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,162 IT Pros & Developers. It's quick & easy.

Highlight a text field when respective radio button is clicked

P: 1
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="JAVASCRIPT" %>
<!-- #include virtual="/header.asp" -->
<%
/**
* file: application/inventory/add.asp
* description: allow users to add a new vehicle to the DB
**/
%>
<script language="javascript">

</script>
<%

// the form
Response.Write("<form action='add.asp' method='POST' onsubmit='return 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='Dateactivated' type='text' /></td></tr>");
Response.Write("<tr class='d0'><td>Date Released</strong></td><td><input name='Datereleased' 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=\"search.asp\"' />");
Response.Write("</form");
%>

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

I really appreciate your help...:)
Mar 15 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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