Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Show/Hide Disable/Enable Form Elements
Old 06-13-2006, 10:41 AM Show/Hide Disable/Enable Form Elements
Average Talker

Posts: 25
Trades: 0
Hi All,
I have a form with a drop-down list where the User will select No or Yes.
If Yes is selected, I would like a text input box to be shown and one of my submit buttons to be enabled, whilst another submit button will automatically become disabled.
I am very new to this and have trawled the net looking for simple, easy-to-understand code and believe this can only be done with Javascript? So apologies if this is in the wrong forum.
My code snippets are:
Code:
<tr><td width="199" bgcolor="#260063">
  <font color="#FFFFFF" face="Sky InfoText Bd">Emergency?: </font> </td>
<td width="17">&nbsp;</td>
<td width="360"><select name="emergency">
   <option value="No" show="none">No</option>
   <option value="Yes" show="justification">Yes</option>
   </select>
</td></tr>
<tr relation="justification"><span class="accessibility"> If Yes:</span><td width="199" bgcolor="#260063">
  <font color="#FFFFFF" face="Sky InfoText Bd">PROVIDE JUSTIFICATION FOR EMERGENCY CHANGE: </font> </td>
<td width="17">&nbsp;</td>
<td width="360"><textarea name="emergency_justification" rows="3" size="150" cols="38"></textarea></td></tr>
When I view the page, the PROVIDE JUSTIFCATION FOR EMERGENCY CHANGE input box is shown irrespective of whether Yes or No is selected.
So somewhere I have messed up the code.
Additionally, once YES is selected, I would like my "Submit to Change Control" button disabled and my "Submit Emergency Change" button to become enabled.
Code:
<input type="submit" name="Submit" value="Submit to Change Control"> 
<input type="submit" name="Submit1" value="Submit Emergency Change" disabled=true>
Would some simple SQL IF THEN statements deal with this?
Thanks in advance for any assistance,
Lynn
devine is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-13-2006, 01:38 PM Re: Show/Hide Disable/Enable Form Elements
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
You're right. This can only be done in Javascript.

ASP is a server-side programming language only. While you can use ASP to output Javascript, you can't actually control elements of a page using ASP like you can with Javascript.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to Show/Hide Disable/Enable Form Elements
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10333 seconds with 12 queries