|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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"),",","%") |
|
#3
|
|||
|
|||
|
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:
|
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||
|
|||
|
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???? |
|
#6
|
||||
|
||||
|
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 |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Change default delimiter |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|