Chris T.
|
| Posted: 01/26/2006, 9:28 AM |
|
I have 5 checkboxes
If one gets checked, then it sends some text to a field for later use. Ex. If the checkbox APPLE is checked, then it sends the text "apple" to a field in the table.
If more than one are checked, I want the text to be appended, so that all the checkbox's text will be in the same field.
Ex. If checkbox APPLE and checkbox BANANA are checked, then "apple" is added to the field and "banana" is added/appended to the same field.
what would be the code for that? Right now I use:
If table.checkboxapple.checked = true then table.textbox1.value = "apple"
but am unsure when it's time for the next choice:
if table.checkboxbanana.checked=true then table.textbox1.value ?? = "banana"
could I do: if......then table.textbox1.value = table.textbox1.value & "banana"
|
|
|
 |
Chris T.
|
| Posted: 01/26/2006, 9:42 AM |
|
Nevermind. I figured it out.
|
|
|
 |
Chris T.
|
| Posted: 01/30/2006, 9:35 AM |
|
Ok, so I didn't figure it out.
If I have five checkboxes, and they each have a corresponding fruit. If a checkbox is checked, then that fruit name is put into a textbox which is linked to a field in the database.
So if the checkbox for apple is checked, then "apple" is put into this textbox/field
If apple, and orange are checked, then "apple" and "orange" are put into this textbox/field
I have it set up now that when the form is submitted (onclick):
if form.applecheckbox.checkedvalue=true then
form.textbox.value = "apple"
end if
if form.orangecheckbox.checkedvalue=true then
form.textbox.value = form.textbox.value & " " & "orange"
end if
etc...
the textbox is linked to a field in the database, and when I look at this field in the database, no matter what boxes I checked (or if I didn't check any boxes), it fills up the field with every fruit name
|
|
|
 |
Walter Kempees
|
| Posted: 01/30/2006, 10:48 AM |
|
Chris
You unfortunately failed to mention your development language, while at it
you might also want to post this question in the appropriate forum.
But while at it, Where is your above mentioned code place, in which
embepoint Submit.OnClick I take from your text.
It appears from your text that the evaluation if form.varia.checkedvalue =
true is alway true.
It might be handy to debug the outcome of the evaluation, and take it from
there.
<ChrisT.@forum.codecharge (Chris T.)> schreef in bericht
news:243d906d63cc1b@news.codecharge.com...
>I have 5 checkboxes
>
> If one gets checked, then it sends some text to a field for later use.
> Ex. If
> the checkbox APPLE is checked, then it sends the text "apple" to a field
> in
> the table.
>
> If more than one are checked, I want the text to be appended, so that all
> the
> checkbox's text will be in the same field.
> Ex. If checkbox APPLE and checkbox BANANA are checked, then "apple" is
> added
> to the field and "banana" is added/appended to the same field.
>
> what would be the code for that? Right now I use:
>
> If table.checkboxapple.checked = true then table.textbox1.value = "apple"
>
> but am unsure when it's time for the next choice:
>
> if table.checkboxbanana.checked=true then table.textbox1.value ?? =
> "banana"
>
> could I do: if......then table.textbox1.value = table.textbox1.value &
> "banana"
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
Chris T.
|
| Posted: 01/30/2006, 11:54 AM |
|
sorry, i'll post in .asp forum
|
|
|
 |
Walter Kempees
|
| Posted: 01/31/2006, 2:29 AM |
|
And I answered it there, please acknowledge.
<ChrisT.@forum.codecharge (Chris T.)> schreef in bericht
news:243de6edb516ff@news.codecharge.com...
> sorry, i'll post in .asp forum
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|