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
ADVERTISEMENT
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
I am trying to write a basic holiday booking system for the company I work for, it is quite simple in that the user selects the dates they want off work, and they can view if it has been approved or not. It has an admin screen so that the manager can go in and approve the holiday request.
To do this I would like the admin screen to display all the dates in the database that the user has selected off and to have a checkbox next to each that the manager can select to approve it. However I don't know how I would do this, at present all it does is read the info in the database. Code:
View Replies
View Related
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
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
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
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
i have a page that enters numbers stored in different values e.g monday tuesday wednesday thursday friday into a database. is it possible in asp to add those values up and store the added up value in a seperate field in the database
bascially
total =monday+tuesday+wednesday+thursday+friday
How would i do that in asp.
View Replies
View Related
i am trying to add to values togher but each time i try it dont work.
for example
when i try to add 7 and 3 i get 73 and not i want what is 10
i am using the below code
money=RS2("bank")
RS2("bank")=money + pay
response.Write("money="&rs2("bank"))
The DB code is fine as it is recording and pulling the data of te Database but i cant add them up only togher.
View Replies
View Related
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
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
View Related
I was hoping that someone could help me in getting the sum of a column(item_amount). The table is populated through a repeating loop with information pulled from a database. Code:
View Replies
View Related
I have searched the forums and can't seem to find out how to do this. I have a set of values in a column in a database, I want to add all those values up then display them.
View Replies
View Related
I am trying to add entries in a database together and place the summed value into a text box. Like a total ordered type function for an ecommerce site. I have a field called ArmChairs in my database and based on how many people buy them, I want to know how many I need to have shipped.
I am really struggling with this last bit and would be really appreciative if someone has some code examples.
View Replies
View Related
I want to add intQuantity of all records that have the same prodID. I have tried all sort of variations but I don't seem to get it. I would imagine that it must be simple, that's why I can't get it.
SELECT SUM ( intQuantity) AS ItemTotal
FROM tblOrders
WHERE prodID = ? no clue
Or can I do that in ASP? doing something like (my example doen't work)
<%= (rsOrders("intQuantity") + rsOrders("intQuantity")) %>
in the mean time I'll be looking around for an answer to my lack of know how.
View Replies
View Related
I am trying to total the value of some form fields I am referecing the form
field with an inner loop, I am having a little trouble because the amount of
fields returned is always different, how can I roll-up the total of the form
fields (request.form("subtotal_"& i)) to get one final figure? Code:
View Replies
View Related
I have the following snipet that I want to add two values from a recordset together.
sLoss = the running total for all records. totLoss = the total for this particular record.
PHP Code:
sLoss = sLoss + rs.fields.getValue("sLOSS") + rs2.fields.getValue("LOSS")
totLoss = rs.fields.getValue("sLOSS") + rs2.fields.getValue("LOSS")
Response.write totLoss
I keep getting the following error: PHP Code:
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: ""]'
/asp/report/cost.asp, line 527
How come I am having trouble adding these values?
View Replies
View Related
I've writen the code below which displays a drop down select menu and can be displayed by writing the variable 'sjobs'. The code works fine as it is and the menu is populated with the requested info from the database ok. The problem I'm having is adding url links to the menu values. Code:
View Replies
View Related
I want to call a recordset so you can edit the details and then obviously pass the parameters onwards into the db. However, the user guide just says this:
To process other fields in the form, use the Form collection of the upload object the same way you would use the Form collection of the Request object. For example, if your form had a text element named UserName, your processing code would include: Code:
View Replies
View Related
i need to convert the escape values which are by mistake updated in DB.
example:
this is a sample text string
is updated in DB as
this%20is%20a%20sample%20text%20string
here %20 is the space.
like wise there are many entries for :,'
is there way that i can update all this in a update statement?
or use asp to to update the records?
View Replies
View Related
I have a variable SET which has the value Of 1, 2, 3, .., N.
SET=val1, val2, val3, val4, ..., valN
What is the commend or procedure to extract individual values, val1, val2, ...
View Replies
View Related
is there a way of having a dropdownlist and a text field with a checkbox so that you can check a box and have the vaule assigned from a option selct list or check another box and have the value assigned from a textfield?
View Replies
View Related
I would like to make an interaction with a database using ADO and SQL. I would like to display some parts of the database using checkboxes to choose the different parts. But I don't know how to build the SQL command in fuction of which checkbox is checked.
View Replies
View Related
how to write sql to give value true in db?
View Replies
View Related
I have a checkbox which is used to determine whether or not the user wants to display a map of their business with their listing the value of which is being written into a database.
When I am outputting the listings I am just trying to use a simple if else statement
i.e. If(ShowMap = true)Then
Response.Write("<td>Show Map</td>")
Else
Response.Write("<td>No Map</td>")
End If
Problem is I know the database contains different values for ShowMap i.e. some true, some false. Yet when I use this code, No Map is output for all records.
View Replies
View Related
I have a profile search where people can search through our dating profiles. I want to add a checkbox which when checked filters out those records where the recordfield pictures is empty.
I have problems figuring out what the checked value of the checkbox should be and how to use the information from the checkbox in the searchresults page to build the record set. For understanding, if a user does not have a picture the picture field is empty.
View Replies
View Related
I am trying to display the value of a true/false value in my table through the use of the following:
<input type=checkbox name=FieldLabCheck value=" &
objRecordset("FieldLaborSuper") & "></input>
it doesn't work though.... what am I doing wrong.
View Replies
View Related
I have a checkbox in a form from which I want to collect the value.
<input type="checkbox" name="Question11a" value="a">
In the asp page that is called on submit of the form, I declare a variable, iQuestion11a, and request the value of this checkbox:
iQuestion11a = Request("Question11a")
When I print out the value to an html page <% response.write(iQuestion11a) %> it is empty.
View Replies
View Related
I made this code:
....
<%
dim xyz
xyz = Request.Form("checkbox1")
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<FORM action="Forwarding.asp" method=post id=form1 name=form1>
<INPUT type="checkbox" id="checkbox1" name="checkbox1"><BR>
but, xyz can't get the "checkbox1"'s value.
View Replies
View Related
When using checkboxes on a form, if you uncheck them, the unchecked name/value pair in the Request.Form collection doesn't show up. It only shows when the checkbox is set to ON. Is this correct? What's the workaround if it is?
View Replies
View Related
I know there is a way to update records with a checkbox. Is there a way to update this records (with different value)by unchecking the checkbox?
View Replies
View Related
anyone have any idea how to do checkbox with textbox beside.
View Replies
View Related
if i want to display many records from database with each record has one checkbox.. if the record do not meet the constraints.. e.g. if supplier name has no email address.. then that checkbox will be disabled....the rest will appear.. i tried the disabled/// but no result.
View Replies
View Related