473,659 Members | 2,540 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inserting checkbox values into text field

Hi

Was wondering if anyone could help me with this problem :

If I have three checkboxes with different values on a form like :

<input type="checkbox" name="checkbox" value="1stValue ">
<input type="checkbox" name="checkbox" value="2ndValue ">
<input type="checkbox" name="checkbox" value="3rdValue ">

And I needed to submit that form so that the values end up in a text field
called CHECKBOX_TERMS with an AND in between each, so that the text field
on the same form has in effect '1stValue AND 2ndValue AND 3rdValue'
contained within it.

Which is the best way to do it ?

Thanks

JT


Sep 8 '06 #1
1 2196
J Talbot wrote:
If I have three checkboxes with different values on a form like :
<input type="checkbox" name="checkbox" value="1stValue ">
<input type="checkbox" name="checkbox" value="2ndValue ">
<input type="checkbox" name="checkbox" value="3rdValue ">
And I needed to submit that form so that the values end up in a text field
called CHECKBOX_TERMS with an AND in between each, so that the text field
on the same form has in effect '1stValue AND 2ndValue AND 3rdValue'
contained within it.

Which is the best way to do it ?
To change the server side script.

Something along the lines of:

my $CHECKBOX_TERMS ;
my $sep = "";
foreach my $checkbox ($cgi->param('checkbo x')) {
$CHECKBOX_TERMS .= $sep . $checkbox;
$sep = " AND ";
}

Sep 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4625
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input type="checkbox" name="chk_Complete" value="<%Response.Write l_IsChecked%>"<%if cbool(l_IsChecked) then Response.Write " checked"%>> The code to captures the checkbox value in the asp page that builds the sql string is follows
1
1363
by: Yama | last post by:
Hello, Can someone tell me how to insert text into a table containing a TEXT field? How to update? I would like to create a stored procedure that take a text parameter and inserts it into a new column in my table. Then do the same stored procedure but this time to update the TEXT field. HELP!
0
1495
by: wjer | last post by:
I am trying to do two things for a test app: 1) Populate a CheckboxList webcontrol by loading a list of subject names (for the DataTextField) and subject codes (for the DataValueField). 2) Respond to user selection by inserting their boolean values based on checked vs. unchecked boxes. I have a SQL Server table with a lot of columns of data type bit. All of the columns are named after different subject codes (such as HSmath, HSast, etc.)...
2
4715
by: clinttoris | last post by:
Hello, If someone could help me it would be appreciated as I am not having much luck. I'm struggling with my asp code and have some questions relating to asp and oracle database. First question. I have a web survey that I am working on and have successfully dynamically taken the info from a database, displayed it on the screen and then taken the users answers and inserted them into a
4
6734
by: Matt | last post by:
I am no JavaScript guru so please bear with me and be as detailed as possible with your response. I thank you in advance. I have an ASP page that contains form elements. I also have an inline frame on this page that contains multiple checkboxes with the same name/id. This is a search form and users need the ability to select which categories they would like to search for. I have to put the categories in an inline frame to save real...
0
4092
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me with my problems. Now for my new little problem,I had a problem posting the values from checkbox fields to a database and thats the obstacle I overcame. Now the second part is my new problem is that I want that the next time that page loads for...
7
2423
by: bhargavigupta | last post by:
hi, In my application i have one checkbox when ever i am entering values to the page it has to store the values into the database table using insert statement , remaining values r inserting except checkbox value, i dont know in sql server 2005 which data type i have to use for that column to insert the checkbox checked values please reply me its very urgent
0
1064
by: rajesh0303 | last post by:
Iam get null values in the datakeynames AlertID,ItemID while executing the Insert Command....I am Inserting using Externel button Event.Here is the code of Gridiew ,Its datasource and the button event......Need help.... <asp:GridView ID="GridView2" DataSourceID="SqlDataSource2" DataKeyNames="AlertID,ItemID" AutoGenerateColumns="False" runat="server" Width="839px" CellPadding="4" ForeColor="#333333" GridLines="None" AllowPaging="True"> ...
2
3075
by: AlexanderDeLarge | last post by:
Hi! I got a problem that's driving me crazy and I'm desperately in need of help. I'll explain my scenario: I'm doing a database driven site for a band, I got these tables for their discography section: Discography --------------------- DiscID
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.