How to use HTML tags in PHP

Reply

Join Date: Feb 2007
Posts: 11
Reputation: R.S.Chourasia is an unknown quantity at this point 
Solved Threads: 0
R.S.Chourasia R.S.Chourasia is offline Offline
Newbie Poster

How to use HTML tags in PHP

 
0
  #1
Feb 5th, 2007
I am tring to use HTML tags checkbox and textbox along with PHP.
When the checkbox is not checked,the textbox is disable.But when I checked the check box,the textbox should become enabled.

How can i do this?

Here is My code:-

  1. <html>
  2. <head> THIS IS TEST
  3. <title> TEST </title>
  4. </head>
  5. <form>
  6. <body>
  7. CHECK BOX <input type="checkbox" name="htmlchk" value="chk"id="chk"><br>
  8. TEXT BOX <input type="text" id="txt"disabled="True">
  9. <?php
  10. if($chk.CHECKED=="true")
  11. {
  12. $txt.disable="False"
  13. }
  14. ?>
  15. </body>
  16. </form>
  17. </html>


Please help me as soon as possible.
Last edited by stymiee; Feb 5th, 2007 at 10:58 am. Reason: removed bold tags
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: How to use HTML tags in PHP

 
0
  #2
Feb 5th, 2007
This is something you will want to do with JavaScript.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: How to use HTML tags in PHP

 
0
  #3
Feb 5th, 2007
  1. <html>
  2.  
  3. <head>
  4. <script language="javascript">
  5. function checkState()
  6. {
  7. document.testform.tf1.disabled = !document.testform.tf1.disabled;
  8. }
  9. </script>
  10. </head>
  11.  
  12. <body>
  13.  
  14. <form name="testform">
  15. <input name="cb1" value="test" type="checkbox" onClick="checkState()">
  16. <input name="tf1" value="test2" type="textfield" disabled="true">
  17. </form>
  18. </body>
  19. </html>
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 11
Reputation: R.S.Chourasia is an unknown quantity at this point 
Solved Threads: 0
R.S.Chourasia R.S.Chourasia is offline Offline
Newbie Poster

Re: How to use HTML tags in PHP

 
0
  #4
Feb 17th, 2007
Thanks Phaelax,
I got the code sent by you. And now my problem has been solved.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC