p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Web Programming > HTML > HTML Code Clinic
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 21st, 2009, 11:21 AM
Authorized User
Points: 422, Level: 7
Points: 422, Level: 7 Points: 422, Level: 7 Points: 422, Level: 7
Activity: 20%
Activity: 20% Activity: 20% Activity: 20%
 
Join Date: Oct 2006
Location: , , .
Posts: 91
Thanks: 8
Thanked 0 Times in 0 Posts
Default <input type="Checkbox" question???

Hi to all...

Using a input type checkbox or radio button can I set it as checked when reading data of a table in a database…
Meaning…
I have a table with info which 3 of the fields are bits so which holds 0 or 1…
When displaying on screen can I make it checked when it returns a 1 ???

Hope I made it clean…

thanking you in advacnce
Rino...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 26th, 2009, 07:00 AM
Authorized User
Points: 90, Level: 1
Points: 90, Level: 1 Points: 90, Level: 1 Points: 90, Level: 1
Activity: 7%
Activity: 7% Activity: 7% Activity: 7%
 
Join Date: Jul 2008
Location: , , India.
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
Default

i have used php as server side script

In PHP,
Code:
$selected  = ($dbValue == 1)?"checked=checked":"";
Your HTML should be,
Code:
 <input type='checkbox' name='chk1' <?php echo $selected?> >
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to surya For This Useful Post:
RinoDM (November 9th, 2009)
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to theme the "Browse" button of "FileUpload" control? varunbwj BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 October 14th, 2009 02:22 AM
<deployment retail="true"> clarification jsymons BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 October 1st, 2009 03:48 PM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 05:56 AM
<authentication mode="Forms"/> msman88 ASP.NET 3.5 Professionals 10 August 30th, 2009 09:57 AM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 04:09 PM



All times are GMT -4. The time now is 11:27 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc