Hi,
I have a checkboxes on my page (.aspx) like
checkbox1 - item1
checkbox2 - item2
checkbox3 - item3
etc
what i want is that when a user selects certain checkboxes
they should be inserted into a table called
customer which has fields (customer id and actions)
the data should be inserted as
customerid actions
1 item1,item2,item3
2 item1,item3
3 etc..
i.e all the values should be inserted into database into one field separated by commas.
Thanks
Inserting checkbox values into one field
Started by ebosysindia, May 17 2009 09:32 PM
8 replies to this topic
#1
Posted 17 May 2009 - 09:32 PM
|
|
|
#2
Posted 18 May 2009 - 03:09 AM
What code do you have so far for inserting the data?
#3
Posted 18 May 2009 - 03:41 AM
I want text code inserting in the data
#4
Posted 18 May 2009 - 12:16 PM
No, what ASP code do you have written already?
#5
Posted 18 May 2009 - 08:06 PM
still, i am not coding for that, before coding i want some help about it.
#6
Posted 30 May 2009 - 09:36 PM
I am not sure about it. But according to me use of Ajax or javascript onclick or onselect event can make it.
_______________
Design a website
_______________
Design a website
#7
Posted 19 June 2009 - 04:11 AM
hkp said:
I am not sure about it. But according to me use of Ajax or javascript onclick or onselect event can make it.
Thanks for suggestion :)
#8
Posted 24 June 2009 - 03:27 PM
hkp said:
I am not sure about it. But according to me use of Ajax or javascript onclick or onselect event can make it.
It depends on if you would like to do this on the Client or the server side. If on the client Javascript is fine. If you would like to do this on the server side you need to put the code in the code behind and have it fire on the event.
-C
#9
Posted 04 March 2010 - 08:08 AM
well as per what i could get from your question is
1.You have 3 check boxes and after the user has checked the boxes ..
2.Clicks the done button
3.The values selected are entered into the SQl Database
here is what you have to carry on from now:
1.Add 3 checkboxes by best bet would we to have a CheckedList box
2.Now add a Button. [Note: buttons always have the AutoPostBack property set to True ]
3.Now double click the Button. [ you will be taken to the Code Behind file ]
4.add this code to the file:[on the Button1_Onclick event handler ]
1.You have 3 check boxes and after the user has checked the boxes ..
2.Clicks the done button
3.The values selected are entered into the SQl Database
here is what you have to carry on from now:
1.Add 3 checkboxes by best bet would we to have a CheckedList box
2.Now add a Button. [Note: buttons always have the AutoPostBack property set to True ]
3.Now double click the Button. [ you will be taken to the Code Behind file ]
4.add this code to the file:[on the Button1_Onclick event handler ]
string box1, box2, box3;
if (CheckBox1.Checked == true)
{
box1 = CheckBox1.Text;
}
else if (CheckBox2.Checked==true)
{
box2 = CheckBox2.Text;
}
else if (CheckBox3.Checked==true)
{
box3 = CheckBox3.Text;
}


Sign In
Create Account


Back to top









