HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 25th, 2004, 09:37 AM
watersk watersk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 5 watersk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Change default delimiter

Hi
I am working on a project that takes survey answers from an ASP and HTML
page and places them in a SQL Server Database. I am using a post method
to submit the form but everytime I submit mulitiple values for one field it
seperates with commas, as this is the default delimiter. I want to change
the default delimiter to | or % anything but a comma. Can anyone help,
I am really really stuck
Thanks

Reply With Quote
  #2  
Old August 26th, 2004, 04:25 AM
bamboo bamboo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 168 bamboo User rank is Private First Class (20 - 50 Reputation Level)bamboo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I don't know how to change the default delimiter. Perhaps you could use Replace to change the commas after the form is submited. For example:

test = replace(Request.Form("stuff"),",","%")

Reply With Quote
  #3  
Old August 26th, 2004, 04:39 AM
watersk watersk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 5 watersk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks very much for the reply, but I am using a replace() already but then it splits paragraphs answers where the user has used a comma as part of their answer and puts it into a new record, whereas i only want the different field answers to be split when they are automtically separated by a comma.....its a nightmare



Quote:
Originally Posted by bamboo
I don't know how to change the default delimiter. Perhaps you could use Replace to change the commas after the form is submited. For example:

test = replace(Request.Form("stuff"),",","%")

Reply With Quote
  #4  
Old August 26th, 2004, 05:27 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
Hi

You need to do something specific for each FORM element posted to your script:

Code:
For Each str_ItemFound In Request.Form
Select Case str_ItemFound
Case "NameOfYourMultiValueInputField"
''' Do something here to handle splitting the multiple values and/or replacing the delimiter
Case Else
''' Do something different
End Select
Next
MK

Reply With Quote
  #5  
Old August 26th, 2004, 08:55 AM
watersk watersk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 5 watersk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
HI tanks for the reply

But everytime I add in text fields that has commas in the
text then it splits that

i.e.

1,4,6 multivalue checkbox answers with commas
This a test, carried out by me,today,10pm

so you see the first string "This is a test, carried out by me"
is complete string and then today and 10pm are the two other values
for the multivalue answer. I want the database to look like this

Id answer
1 1
2 4
3 6
4 This is a test, carried out by me
5 Today
6 10pm

But it keeps doing this:

Id answer
1 1
2 4
3 6
4 This is a test
5 carried out by me
6 Today
7 10pm
Because I use split(answer,",") thats why I was trying to change the delimter to |
so it would like this

This is a test, carried out by me|today|10pm and the split(answer,"|")

Can anyone help me????

Reply With Quote
  #6  
Old August 26th, 2004, 10:10 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
Then you are not looking at each field to determine whether it is a multiple-choice option delimited by a comma or a free text input box including commas

When you look through your fields, you need to explicitely determine what to do with each field. If the field is a multiple-choice option, get the value and deal with it by changing the delimiters. If it's a free input box, it just needs dumping straight to the database

I suggest you post your script(s) here

MK

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Change default delimiter


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway