DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Discuss "checkbox" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). The Classic ASP forum is for ASP/VBScript and ASP/JScript applications.


Reply « Previous Thread | Next Thread »
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old June 19th, 2008, 12:44 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default checkbox

Hi,

I have 7 checkboxes. If the user selects the other one they enter some value in the textbox
Code:
<input type="checkbox" name="question1" id="question1" value"1">1
<input type="checkbox" name="question2" id="question2" value"2">2
<input type="checkbox" name="question3" id="question3" value"3">3
<input type="checkbox" name="question4" id="question4" value"4">4
<input type="checkbox" name="question5" id="question5" value"5">5
<input type="checkbox" name="question6" id="question6" value"6">6
<input type="checkbox" name="Other" id="Other" value"Other">Other

<input type="text" name="othertxt" id="othertxt" value="">
what i want to do is add the data in one field called Choice

so if someone selects 3,5

the data should be added like this 3,5

if someone selects 1,5, Other

Then the data should be added as

1,5, Other - some text

can someone tell me how i can make my string to add the data in the table

whats the easiest way to check if the checkbox was clicked or not

todd

Last edited by todd2006; June 19th, 2008 at 01:14 PM.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old June 19th, 2008, 01:12 PM
Rebelle's Avatar
Contributing Member

 
Join Date: Mar 2008
Posts: 157
Thanks: 29
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

why are all the values 1 ?
Reply With Quote
  #3 (permalink)  
Old June 19th, 2008, 01:14 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

sorry the post is updated
Reply With Quote
  #4 (permalink)  
Old June 19th, 2008, 01:48 PM
Wolffy's Avatar
Slaprentice of Wolves


 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 146
Thanks: 1
Thanked 23 Times in 20 Posts
Rep Power: 1
Wolffy is on a distinguished road

Awards Showcase
Microsoft .Net 
Total Awards: 1

Default

Before we go too far down a wrong road and can't turn around, what are you going to do with the comma string?
__________________
Wolffy
------------------------
Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary.
Reply With Quote
  #5 (permalink)  
Old June 19th, 2008, 01:53 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 530
Thanks: 14
Thanked 38 Times in 37 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead is on a distinguished road

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

Quote:
Originally Posted by Wolffy View Post
Before we go too far down a wrong road and can't turn around, what are you going to do with the comma string?
My guess is that it's going to end up in a single field in the database
__________________
jmurrayhead
Did I help you out? Make me popular by clicking the icon!

If you found a post helpful, please click the button in the lower right-hand corner of the post.

Powered by ASP.Net
Reply With Quote
  #6 (permalink)  
Old June 19th, 2008, 02:01 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

I just want the data to be stored in one field
Reply With Quote
  #7 (permalink)  
Old June 19th, 2008, 02:06 PM
Wolffy's Avatar
Slaprentice of Wolves


 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 146
Thanks: 1
Thanked 23 Times in 20 Posts
Rep Power: 1
Wolffy is on a distinguished road

Awards Showcase
Microsoft .Net 
Total Awards: 1

Default

Thought so. Again, you shouldn't store multiple values in a field. Period. What is you intention for these numbers once stored?
Reply With Quote
  #8 (permalink)  
Old June 19th, 2008, 02:20 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

thats how the client wants it i explained its not good but hey they want it in that way

my only problem is how to find if there was a comma at the end of the string and if there is a comma remove it
Reply With Quote
  #9 (permalink)  
Old June 19th, 2008, 02:26 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 530
Thanks: 14
Thanked 38 Times in 37 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead is on a distinguished road

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

Quote:
Originally Posted by todd2006 View Post
thats how the client wants it i explained its not good but hey they want it in that way
Why do they decide the design of the database? Are they database experts? Do they even have any experience in database design? Or are they just completely retarded? A client should only tell you what they need the application to do and let you work your wonders.

Quote:
Originally Posted by todd2006
my only problem is how to find if there was a comma at the end of the string and if there is a comma remove it
The simple solution is to always append a comma to the end of each value you're concatenating and then trim it off when you're done.
Reply With Quote
  #10 (permalink)  
Old June 19th, 2008, 02:40 PM
Wolffy's Avatar
Slaprentice of Wolves


 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 146
Thanks: 1
Thanked 23 Times in 20 Posts
Rep Power: 1
Wolffy is on a distinguished road

Awards Showcase
Microsoft .Net 
Total Awards: 1

Default

Ditto
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
checkbox validation todd2006 JavaScript Programming 3 June 18th, 2008 07:22 PM
display problem checkbox todd2006 JavaScript Programming 4 May 30th, 2008 03:58 PM


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 07:38 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46