Insert Checkbox Values From Dynamic Record Set

A page displays the Product literature that a customer can request to receive by postal mail by clicking a check box. The literature selections are created by a dynamic record set based upon what the company enters into the Literature table (currently 10 selections). The checkbox form tags are:

<input type="checkbox" name="LiteratureID" value="<%= rs("LiteratureID")%>">

LiteratureID is the Access autonumber primary key field. I can use the LiteratureName in the "name" attribute if it is easier.

The form processing page needs to Insert each selection into its own record in another table. This "requested" table also inserts the database ID for the customer that is created after first inserting the customer contact info. In other words the "requested" table needs to record the customer autonumbered db ID and each selected checkbox value.

Here is my current code:

View Replies


ADVERTISEMENT

Is It Possible To Insert All Checkbox Values Into 1 Field In The SQL Database?

Is it possible to insert more than 2 checkbox values into 1 field in the SQL database?

I have 5 checkboxes; I would like to insert them all into 1 column in the SQL DB.
If I insert more than 2, it gives an error.

View Replies View Related

How To Prevent Duplicate Values When Using BULK INSERT To Insert CSV To SQL Server?

How to prevent duplicate values when using BULK INSERT to insert CSV to SQL Server? Code:

View Replies View Related

Dynamic Checkbox

I have a table in ASP page which displays records and it has a checkbox whose name is ChkBox<%= intRecID %>

<%= intRecID %> is the ID of that record. Now how should I chck whether check box is not checked.

View Replies View Related

Dynamic Checkbox

I have a form with x amount of checkboxes called "majestic". But i only want the user to select one.How do i go about this in javascript or is there an asp alternative.

View Replies View Related

Checkbox To Insert Data

Is it possible to insert values in a Database with a
checkbox? Say I have a recordset and if the check box is checked I
want to insert the value of the of the field in the DB.

<%=rsqa.Fields.Item("recini").Value%>

That is a persons initials, i want to insert those initials in a column
if it is checked, if it isnt checked nothing is inserted..

View Replies View Related

Insert Value Of Checkbox To The Database

what Im trying to do is to insert into the database the values of the checked checkboxes of the recordset fields the appear in the table I've written the following code:

View Replies View Related

Multi Checkbox Insert

I have a form that is passing a number to check box values with the same name (productID) but different values (numerical values). It is also passing a warehouseID as a hidden field.

I need to dump these values into an access table called wtbProductWarehouses with fields titled ProductID and WarehouseID. What is the code that I need to write to have it loop through all of the productID values and individually add each one to the db while also adding the warehouseID with it.

View Replies View Related

Multiple Insert With Checkbox...

This is my problem... its for a mailing list with categories...

I have 3 table...

1 : Name,City,Email

2 : Categorie

3 : Name_id , Categorie_id

So when a user fill up the mailing list form, he can check as many categorie he want...

but how i can insert 1 row in my table #3 for each checkbox checked...

Can someone post me a simple script...

View Replies View Related

Dynamic Checkbox With Database

i have list of items as a list.Now user can select any item in that list. Now what i do is create checkboxes to enable user to check the item which has to be selected.

1. Checkboxes are dynamic.

2. I create checkboxes with one name assign value = Itemcode value so that when form is submitted i can get the itemcode value as a comma seperated list and which would be easy for me to put it in a database query.

3. the part i have problem is i have to display those checkboxes ticked back to user , ie after form submit i have to make the checkbox which are previously checked, to be in checked state.

request.form("Chkgroup")="1,4,5,6,9,10"

assume this is an arrray i am getting from form element.what is the easiest and efficient method so that i can make those checkbox checked again.

View Replies View Related

Dynamic Checkbox Problem

i have a few fields in my db that are true or false and i want to link them to my asp page on to checkboxs.

i've tried to set the checkbox value to Code:

value="<%=rs.fields("yn").value%>"

but it doesn't work How can this be done?

View Replies View Related

Getting Checkbox Values

I have a page with a checkbox on it (chkMyBox). I want to be able to click on it and redirect the page back to itself, showing the box checked when it resubmitts. How can I do this?

View Replies View Related

Checkbox Values

I need to get the values of a number of checkboxes without A) Resorting to calling them all the same thing and using the below to sort it out: Code:

ValueA = Split(Request.Form("a"),",")
For i = 0 to uBound(ValueA)
response.write(i)

Response.Write(trim(valueA(i)))

Next

or

B) Having a request.Form for each one (There could be in excess of 40 checkboxes; the number changes).

View Replies View Related

Insert Record Goto Last Record

I have an insert record form that posts fine to a db which automatically creates an ID how could I get the next page to do a preview using the ID just created by the DB to go to the right record?

View Replies View Related

Insert Checkbox Vaule To Database

I am having problems inserting checkbox data into my database. The string data from the text files in my form have no problems being inserted in the db. Code:

View Replies View Related

Dynamic Checkbox Form Processor

I have a form with dynamic checkboxes, and normal text boxes. If the user doesn't fill out the required items and submits the form they get returned back to the form with their checkbox selection gets lost.

How do i retrieve the values already checked and placed them back.

View Replies View Related

Adding Checkbox Values

I am trying to create a 'build a quote' page in which a user can checkoff checkboxes and have the total add up once the submit button is clicked. An example of the code I am using is

<form action="add.asp" method="POST">
option 1 value is 5<input name=""check"" type="checkbox" value="5"><br>
option 2 value is 9<input name=""check"" type="checkbox" value="9"><br>
option 3 value is 1<input name=""check"" type="checkbox" value="1"><br>
option 4 value is 2<input name=""check"" type="checkbox" value="2"><BR><BR>
<input name=""Submit"" type="submit"> <input type="reset" value="Reset">
</form>
<hr>
<%
arrB = Request.Form("check")
arrA = split(Request.Form("check"), ", ")
If arrB<>"" then
For each x in arrA
total = x
next
response.write(total)
end if
%>

View Replies View Related

Checkbox Values Sorted?

im not that good at asp, infact im using dreamweaver to make my pages up! what i would like to do is show a list of items and price in a table, with a checkbox next to them, the form is submitted and then on the next page i would like to display the the items that have been checked.
I think i have the first page sorted, i have linked the checkbox to the product ID value in the database, so i can pass that value to the next page. the problem is the second page, i can get it to show the values of the checkbox (eg items 1, 4 ,26...) but only the numbers.How do i go about using this value (number) to pull the rest of the data from the table (stored in a mdb)?

im using this in the first page form to pass the checkbox value
<input type="checkbox" name="checkbox" value="<%=(rs_stock.Fields.Item("ID").Value)%>">

on the second page i get the values get shown with
<%= Request.Form("checkbox") %>
im at a loss on how to do this

View Replies View Related

Adding Checkbox Values

I have 2 pages - form.asp and result.asp. in form.asp, i have multiple checkboxes with varying values, like:

<html>
<body>
<form action="result.asp" method="get" name="form">
Name1: <input type="checkbox" name="1" value="5">
Name2: <input type="checkbox" name="12" value="7">
Name3: <input type="checkbox" name="12" value="9">
Name4: <input type="checkbox" name="12" value="11">
<input type="submit" name="submit">
</form>
</html>

I seek to capture these values and add them up in the result.asp page. e.g. if name1 and name3 are selected, i want the total of 14 to be shown up in result.asp page. I need help here for the asp code for the above. Or, may be some advice on how the above can be accomplished.

View Replies View Related

Updating Via An INSERT Query Controlled By Checkbox

I have a form that if a user selects a certain option from a dropdown list a checkbox will appear. This checkbox references information from another table and then multiplies a figure before it is submitted (well, that's the theory anyway!)

I can't seem to get the multiplier to work. Can someone please give me some advice to this? I've included some simplified code that concentrates on the areas that I'm having difficulty. Code:

View Replies View Related

Validate Fields When A Dynamic Checkbox Is Selected

I am trying to make several fields in a HTML form validated, but only
when a dynamic checkbox is selected. I am not sure how to do this.

Here is a snippet of the dynamic checkbox code:

<%
Set RSLIST = Server.CreateObject("ADODB.Recordset")
SQLLIST = "SELECT * FROM Newsletters ORDER BY Newsletter_Name"
RSLIST.Open SQLLIST, Conn, 1, 3
%>
<%Do While Not RSLIST.EOF%>
<input type="checkbox" name="Newsletters"
value="<%=RSLIST("ID")%>"><%=RSLIST("Newsletter_Name")%>

I would like to make three fields (company, phone_work, license)
mandatory when one of the "ID" (i.e. ID 2) is checked.

View Replies View Related

Sending Checkbox Values To E-mail

I am trying to Send the values of checkboxes to the user's email
and display in the form of List <li></li>. The values of checkboxes
are sourced from a table in my access DB. I am using Jmail to send
this info. Can anyone please help me how to retrive values from the
check boxes, split, make a list and send in the body of e-mail.
Here is wht I 've done so far :

uname = Request.Form("name")
uemail = Request.Form("email")
chk = Request.Form("checkbox")
chk = Replace(chk,",","<br>")
chk = " " & chk
mailserver = "my.mailserver.net"
recipent = uemail

msg = "<html><body> Dear " & uname & ",<br>Thank for requesting our product list." &_
"<br>This is what u requested : <br>" & swnp & "</body></html>"

Set Mail = Server.CreateObject ("JMail.SMTPMail")

Mail.ServerAddress = mailserver
Mail.Sender = "email@mydomain.net"
Mail.Subject = "Your Request"
Mail.AddRecipient recipent
Mail.Body = msg
Mail.Execute

View Replies View Related

INSERT Multiple Records From Checkbox Form With Unique Ids

I have an .asp page with a form to copy job responsibilites form one
job to another. It is a hotmail type interface with checkboxes
besides each responsibility. After submitting, it should copy the
selected resp's to a different job. After that it should renumber
that job's responsibilities.

This is the code I am using now to copy:

copySQL4 = "INSERT INTO
jambue.RESP(POSCODE,IDCODE1,IDCODE2,RESP_NUM,RESP) SELECT '" & id & "'
POSCODE,'" & dept & "' IDCODE1,'" & unit & "' IDCODE2, '999' RESP_NUM,
RESP FROM jambue.RESP WHERE (POSCODE = '" & POSCODE & "' AND IDCODE1 =
'" & sourceDept & "' AND IDCODE2 = '" & sourceUnit & "') AND RESP_NUM
IN (" & Request.Form("chk") & ")"

As you can see the value '999' is hardcoded in there as the new
Responsibility Number to go with the copied responsibility. I use
this because there are no jobs with that many responsibilities. This
works fine if I only select one resp. to copy over. But if I select
more than one that part still runs fine but I get an error with the
below. It says too many rows would be affected. Of course, this must
be because there are now at least 2 responsibilites with the same
RESP_NUM. Code:

View Replies View Related

Insert Record

Is it possible to, whilst inserting a new record, use a session variable from a previous page for one of the fields?

View Replies View Related

Insert Record

am trying to get my ASP page to write session variables into an Access database. However I'm getting error messages. I'm not sure if I used the right syntax (using double " for example) Can anyone see a problem:

'Command1.CommandText = "INSERT INTO tbl_quotewedding (coverllevel, weddingdate, marqueecover, publicliability, quote) VALUES ('"" & session(""svCoverLevel"") & ""','"" & session(""svWeddingDate"") & ""','"" & session(""svMarqueeCover"") & ""','"" & session(""svPubLiab"") & ""','"" & session(""svTotalCost"") & ')"


I know that the code below works OK so it must be something to do with how I've included the session variables

Command1.CommandText = "INSERT INTO tbl_quotewedding (coverllevel, weddingdate, marqueecover, publicliability, quote) VALUES ('silver', '30/11/2004', 'No', 'No', '55')"

View Replies View Related

Insert A Record

ive created a database using access, and ive successfully created a ole db connection to a webpage using dreamweaver. i can view records without any problems but when i try to add a record tothe database from a webpage form i get the following error msg

Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/guitarguide/guestbook.asp, line 115,

the field names in the database table start with txt_ e.g. txt_name, txt_email etc.

View Replies View Related

Insert Record

need to retrieve a record from a table (tblBookingForm) in one database and insert it into a table (tblNetServ) in another database on the same server,leaving the original record in place.Cant get my head round it though, doesn't seem to want to connect to 2 databases at the same time.

View Replies View Related

Insert Record

I want to submit a record to my db via a simple form but return the user to the same page upon submission ie place a form on index.asp and the form action="index.asp".

My logic isn't quite right, can someone guide me in the right direction? This is what I have, upon submitting the details the page just reloads and the record is not inserted.

<form method="post" action="index.asp">Name<br><input type="text" name="Name" id="name"><br>Email<br><input type="text" name="Email" id="email"><br><input type="submit" name="submit" value="submit"></form>
<%
If Request.Form("submit") = "submit" then
call MailList
End If
%>

View Replies View Related

Insert A Record

I am inserting a record into a table to hold information about photos and what to create a folder with the same name as the primary key value of the inserted record. Eg if I have a table (tblAlbum) with two fields (albumID, albumName) and run an insert statement 'INSERT INTO tblAlbum (albumName) VALUES ('test album')`.

I want to then create a folder with the new value for albumID. How do I retrieve this new value just created?

View Replies View Related

Insert Record

I am using Dreamweaver to create the insert record code for an access database. When it adds the code, I can not see the page on the website. If I remove the code the page works fine. I'm not sure what is going on?

View Replies View Related

Insert Record

i have an access database that has an autonumber as the keyfield. how do i add a record with the autonumber left out so it is put in automatically by the database. i have this at present as my sql statement but dont know what to put in for the autonumber:

Code:

sqlstr = "INSERT INTO Jobs VALUES (" & " " & ",'" & JobName & "','" & Company & "','" & JobField & "','" & Contact & "','" & Website & "','" & Desc & "','" & Salary & "','" & Picture & "')"

the autonumber is the first record in the table

View Replies View Related

Insert Record

i am trying to insert a new record in access using vb language in asp it just insert the id which is a auto number here is my code:

View Replies View Related

Dynamic Record

I am trying to create a recordset that is dependant on who is logged in. Here is a look at the SQL I have tried with no luck.

SELECT *
FROM picks
WHERE (((picks.PlayerID)={Session.MM_username}));

Sorry if this belongs in the sql forum, I wasnt sure as I am using an asp page.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved