Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

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). Visit the ASP Development forum for help with ASP/VBScript and ASP/JScript applications.


Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old June 19th, 2008, 12:44 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
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  
Old June 19th, 2008, 01:12 PM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 256
Thanks: 48
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  
Old June 19th, 2008, 01:14 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
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  
Old June 19th, 2008, 01:48 PM
Wolffy's Avatar
Slaprentice of Wolves
 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 175
Thanks: 3
Thanked 24 Times in 21 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  
Old June 19th, 2008, 01:53 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 863
Thanks: 20
Thanked 78 Times in 75 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net 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
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding
Reply With Quote
  #6  
Old June 19th, 2008, 02:01 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
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  
Old June 19th, 2008, 02:06 PM
Wolffy's Avatar
Slaprentice of Wolves
 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 175
Thanks: 3
Thanked 24 Times in 21 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  
Old June 19th, 2008, 02:20 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
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  
Old June 19th, 2008, 02:26 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 863
Thanks: 20
Thanked 78 Times in 75 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net 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  
Old June 19th, 2008, 02:40 PM
Wolffy's Avatar
Slaprentice of Wolves
 
Join Date: Mar 2008
Location: Peoria, IL
Posts: 175
Thanks: 3
Thanked 24 Times in 21 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


All times are GMT -4. The time now is 07:06 PM.



Content Relevant URLs by vBSEO 3.2.0