![]() |
| |||||||
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
| |||
| 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="">
getquestion1=trim(Request.form("question1"))
getquestion2=trim(Request.form("question2"))
getquestion3=trim(Request.form("question3"))
getquestion4=trim(Request.form("question4"))
getquestion5=trim(Request.form("question5"))
getquestion6=trim(Request.form("question6"))
getOther=trim(Request.form("Other"))
getothertxt=trim(Request.form("othertxt"))
If getquestion1 <> "" Then
getquestion1=getquestion1 & ", "
End If
If getquestion2 <> "" Then
getquestion2=getquestion2 & ", "
End If
If getquestion3 <> "" Then
getquestion3=getquestion3 & ", "
End If
If getquestion4 <> "" Then
getquestion4=getquestion4 & ", "
End If
If getquestion5 <> "" Then
getquestion5=getquestion5 & ", "
End If
If getquestion6 <> "" Then
getquestion6=getquestion6 & ", "
End If
If getOther <> "" Then
If getothertxt <> "" Then
getOther=getOther & " - " & getothertxt
Else
getOther=getOther & ", "
End If
End If
finalanswer=getquestion1 & getquestion2 & getquestion3 & getquestion4 & getquestion5 & getquestion6 & getOther
can you guys tell me how to find out if there is comma at the end of string and if so then delete it todd |
| Sponsored Links |
| ||||
| Append the comma if the user selects "Other" anyway. Then you will always have to remove the last character. This is what I suggested a few posts up.
__________________ 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 |
| The Following User Says Thank You to jmurrayhead For This Useful Post: | ||
sbenj69 (June 19th, 2008) | ||
| |||
| here is the code 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="">
getquestion1=trim(Request.form("question1"))
getquestion2=trim(Request.form("question2"))
getquestion3=trim(Request.form("question3"))
getquestion4=trim(Request.form("question4"))
getquestion5=trim(Request.form("question5"))
getquestion6=trim(Request.form("question6"))
getOther=trim(Request.form("Other"))
getothertxt=trim(Request.form("othertxt"))
If getquestion1 <> "" Then
getquestion1=getquestion1 & ", "
End If
If getquestion2 <> "" Then
getquestion2=getquestion2 & ", "
End If
If getquestion3 <> "" Then
getquestion3=getquestion3 & ", "
End If
If getquestion4 <> "" Then
getquestion4=getquestion4 & ", "
End If
If getquestion5 <> "" Then
getquestion5=getquestion5 & ", "
End If
If getquestion6 <> "" Then
getquestion6=getquestion6 & ", "
End If
If getOther <> "" Then
If getothertxt <> "" Then
getOther=getOther & " - " & getothertxt
Else
getOther=getOther & ", "
End If
else
getOther=getOther & ", "
End If
finalanswer=getquestion1 & getquestion2 & getquestion3 & getquestion4 & getquestion5 & getquestion6 & getOther
finalanswer = left(finalanswer, len(finalanswer)-1) now it shows me 2 comma's at end of string so i tried it like this finalanswer = Trim(Left(finalanswer, Len(finalanswer) - 1)) |
| ||||
| Code: If getOther <> "" Then If getothertxt <> "" Then getOther=getOther & " - " & getothertxt & ", " Else getOther=getOther & ", " End If End If Code: finalanswer = Trim(finalanswer) finalanswer = Left(finalanswer, Len(finalanswer)-1) |
| ||||
| I have taken over a system that employs similar methods... ****s me to tears! Fortuantely they only store comma seperated integers, I would look at modifying the design if you can at all, and I would definately not recommend storing strings and integers jumbled up in the same list, but if you must then wollfys on the right track. Last edited by dr_rock; June 19th, 2008 at 08:31 PM. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
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 |