Search Checked In For-next Loop

I have two columns in the database table where one is the "id" and the other "text_data".

I filled on a page checkboxes for the id and textareas for "text_data" per id.

<input type="submit" value=" Search " size="100" title="Search everything selected">

for....
<input type="checkbox" value="<%=RS("id")%>" name="id"><br/>
<%
Response.Write "<textarea "
response.write "name=""Keywordh"""
response.write "value=""Keywordh"""
response.write "rows=""3"" "
response.write "cols=""64"">"
response.write "</textarea>"
next....

There must be something wrong right of the start because when press "search" without checking anything it searches every textarea within the for-next loop. My intention is to search ONLY the textareas that are checked.
But I'm also wondering if it is necessary to have a textarea to make these searches. Is it possible to simply slap the "text_data" alone in the for-next, check the ones I choose and search?

View Replies


ADVERTISEMENT

Search Checked In For Loop

I have two columns in the database table where one is the "id" and the other "text_data".
I filled on a page checkboxes for the id and textareas for "text_data" per id. Code:

View Replies View Related

Db Search Inside A Loop

There are two table in my Access database e.g. people and orders. There is a one-to-many relationship between these. At the moment I get a recordset of all the people. I put the results of this into an array (using GetRows) and close the array and set it to Nothing.

Then on the page I have a loop which goes through the array of people and for each one performs a different db search of all the order linked to that person. On the page I have got it displaying the people perfectly but for each search the RecordCount is coming out as -1. Yet, I know there are orders associated with each person.

View Replies View Related

Value Of Checked Box!?

I've got the following problem:

I'm retrieving data from an SQL Server database. And I want my form to
display a checked box in the state corresponding to the value saved in
the DB. But somehow that doesn't work!?

SQL tells me the value is 1.
My ASP page tells me it's 'True'??

So I tried it like this:
<input name="checkbox" type="checkbox" value="checkbox" <%If
rsDemande.Fields.Item("lien").Value = 1 Then Response.Write("
checked='checked'") : Response.Write("")%>>

and like this:

<input name="checkbox" type="checkbox" value="checkbox" <%If
cstr(rsDemande.Fields.Item("lien").Value) = "True" Then Response.Write("
checked='checked'") : Response.Write("")%>>

But neither works. The checkbox remains unchecked!?

What am I doing wrong?

View Replies View Related

Value Of Checked Box

I'm retrieving data from an SQL Server database (the data itslef was
entered by an ASP form). And on an 'edit form' I want to display a
checked box in the state corresponding to the value saved in the DB. But
somehow that doesn't work!?
SQL tells me the value is 1.
My ASP page tells me it's 'True'??

So I tried it like this:
<input name="checkbox" type="checkbox" value="checkbox" <%If
rsDemande.Fields.Item("lien").Value = 1 Then Response.Write("
checked='checked'") : Response.Write("")%>>

and like this:

<input name="checkbox" type="checkbox" value="checkbox" <%If
cstr(rsDemande.Fields.Item("lien").Value) = "True" Then Response.Write("
checked='checked'") : Response.Write("")%>>

But neither works. The checkbox remains unchecked!?

View Replies View Related

Checked AND Unchecked

Within a submitted page that has mutilple checkboxes with
the same name, the request.form("mycheckboxes") has a
comma separated list of the values of all the ones
checked....

but I also need to know which ones are not checked... How
can I know that ?

View Replies View Related

Checkbox Checked

i m getting value of blnPermit is True .but still not show my checkbox as checked .alredy spent a hour for this. what i m missing? Code:


<input type="checkbox" class="checkbox" id="blnPermit" name="blnPermit" onClick="ChangeStatus()" <%if blnPermit then %>checked<%end if%>>dd

View Replies View Related

Show Checkbox As Checked

How can I show a checkbox as checked based off of the variable stored in a database?

View Replies View Related

Radio Button Is Checked

how can i check if the radio button is checked or not in Asp .

View Replies View Related

Radio Button Can't Be Checked Although Value Get

this is the form that i use to retrive the data from the database to be updated.. the problem is with the gender field..

i have tested the objRS("gender ") which it really did get the value from the database eg male . but it just seems can't make the radio button to be checked.. Code:

View Replies View Related

ASP Checkbox Default Checked From Access

I have a contact list in an Access database.

I have a table that contains contacts a table that contains categories and a third table that is a join table that assigns users to categories in a many-to-many relationship.

I have a script that creates a series of checkboxes from the categories table so when a new contact is added the user can select multiple checkboxes, categories, to place the user into.

I want to be able to edit a contact by clicking their name that takes them to a ContactUpdate.asp form that is already filled with all of the values for the contact. Their name, address, phone number etc. however I want the checkboxes,categories, that the contact is already in to be selected on the ContactUpdate.asp page.

I need the user to know what categories the contact is already in.

Here is the code I already have that creates the checkboxes. When a contact is added so I'm sure the contact update will be some variation: Code:

View Replies View Related

How To Get A Checkbox Checked When Loading The Page?

I have a input with type checkbox. I want it to be automatically checked if the value from the corresponding field in the database is also checked. I tried this: Code:

View Replies View Related

How To Write Value Of Checked List In Textbox

I have a list of checkboxes that when I check I want it to be written in the textbox. I need a space in between the writing of each checkbox checked. Code:

View Replies View Related

How To Write Value Of Checked List In Textbox

I have a list of checkboxes that when I check I want it to be written in the textbox. I need a space in between the writing of each checkbox checked. Code:

View Replies View Related

Want To Make A Particular Check Box Show Up When Another Is Checked

I hope that subject title made sense, but I am looking for a way, and I am not sure if it is ASP or Javascript, but I only want a particular check box to show up if another particular checkbox is checked.

So I have like 5 options, but a "hidden" 6th option. If option #1 is checked, I want option 6 to show up. But if option 2 - 5 is checked, I don't want option 6 to show.

View Replies View Related

How To Check If A Specific Record Was Checked Off In A Form.

I have a server using a webapp built on classic ASP, and I use a library that creates/manipulates a datagrid-style display on the page.

I am displaying a large chart with sufficient data that it will likely be paged, and there are several columns that are toggles (using checkboxes for these, with the entire column having the same checkbox NAME, but different values depending on the record).

I have a piece of script that for loops through the records present on the page (determined by a collection of hidden form values), and then I need to check if the collection formed by a given column contains that value, something like the following (pseudo-code):

View Replies View Related

Form Input (radio Button) Pre Checked...

I'm reading data from an XML form and prepopulating a FORM. For the text inputs I have no problem prepopulating the Values from the file...

document.forms[0].elements['FormName'].value=xmlObj.childNodes(0).childNodes(0).firstChild.text;

But one of my fields is based on input from a radio input (three inputs with a value of 1,2,3). Since they all have the same name using the code above will not set they value for any of them. Anybody else run into this, or have a suggested way I should do this.

View Replies View Related

Parameter Not Passed From For Loop To While Loop

I'm trying to pass a parameter from a for loop to the nested while loop
but only the first counter is passed. Here is the code:

View Replies View Related

Nesting One Loop Within Another, Using 1st Loop As Criteria For 2nd

I have a recordset that I loop through all of the data within a table, within the same loop, I am trying to add another loops that pulls information from the first recordset to base the second recordset off of: Code:

View Replies View Related

Need To Convert Google Search Ref To Find What The User Search

i get the ref url that come to my site and i want to convert it to find
out what was the query in (google or other searcher sites)

foe example : if someone goes to google and search some text and my
site was in his resaults and he click on it , in my site i see his link
ref like
http://www.google.co.il/search?hl=i...91-Google&meta=

i want to know (in asp and save it to DB) what was the word or words
that the user write in search engine.

View Replies View Related

Do While Loop?

I have a case statment like

select case code
case "01"
ups_desc = "OPTION1."
case "02"
ups_desc = "OPTION2."
case "03"
ups_desc = "OPTION3"
case "07"
ups_desc = "OPTION4"
case "08"
ups_desc = "OPTION5 "
case "11"
ups_desc = "OPTION6"
case "12"
ups_desc = "OPTION7"
end select


I then have table called "users" which has the following
id
UserID
Code

now the trick

I want to loop through the recordset of the user tables and populate a drop down where the code from the case and the user table are the same.

Something like

do while rs("code") = code
<option> This then is populated based upon the loop(I have this code)</option>
loop

View Replies View Related

Do While Loop

I need to insert recordes into a db based upon a number returned in a form
Somerthing like

AddRecords = Request.Form("NumberOfRecords")

Count = 0

if Count < AddRecords Then
Do while Count.eof

SQL Code....

Count = Count + 1

Count.move next
Loop
End If

View Replies View Related

How To Loop

i have 2 tables (A & B) with date records
now i loop table A and then table B, the output will be table A in the front
and table B in the back.how can i make the output show by date in both tables altogether?
do i need to combine tables before but the number of records is over 100K
which may spend a lot of processing power?

View Replies View Related

Asp Loop

on my classifieds site i would like to create a simple ads system. i currently have the ads site made but need some advice.

on my classifieds site i would like to display the ads down the left hand side.

however i dont want to over display ads.

if there is not many items listed i only want a small amount of adverts shown on the left hand side. however if there is lots listed
i would like quite a few adverts listed.

otherwise i would have a big list of adverts and only a small number of items listed making a big blank space on my page.

i am guessing this would have to be a loop or something.

the code i am using to show the text links is <%=adurl%>

View Replies View Related

For Loop

I am using a for loop in one of my asp page. Could someone let me know if I can do the for loop as follow:

[code]<% for i = 1 to 5 %>
my html code
my html code
my html code
<% Next i %>
instead of
[code]<%
for i = 1 to 5
Response.Write "<input name = 'id'"&i&" type='text' value = "&id& ">"
Next i
%>

View Replies View Related

More Than 1 Do Loop

I am using ASP and need a DO LOOP to get some info back from the db. but the asp reads the first do loop but does not read the second one ......

View Replies View Related

While Loop

is there any function or statements that work the same as the 'break' statement in C++ language?

for example:

While Not rs.EOF
If rs("LoginID") = userId Then
break 'what shd i use for ASP???

Else
rs.movenext

View Replies View Related

Loop Within A Loop

im writing some script to add records to my db. but if a value thats about to be added exists, then dont add that record.for example: if i want to add 7 records to my db with the values 1 - 7, but the db already has 3, 5 and 7, then it should only add 4 new records (1, 2, 4 and 6).

i have a record returning all records form my db, and an array with the values i want to add. i want to loop through my recordset of all existing entries, then for each loop, start another loop to see if the value exists, and if it doesnt , then add a new record.

View Replies View Related

For Loop Or Do While Loop

How to use the for loop or do while loop to create the age range from 10 -100 to let the user to select from the form object - list/menu by using asp? The coding below is just a concept. For example

Response.Write("<select name=""select"">")

for (a=0; a<101; a++)
(
Response.Write("<option value=""" & age & """>" & age & "</option>")
)

Response.Write("</select>")

View Replies View Related

If Then Else Loop

I'm trying to create a page where images are displayed based on an id in a sql table (basically its an unlit candle until a value in the id field exists). I'm not getting an error with my code below - but its not working right either. Code:

<% If rs("my_id")="2" Then Response.Write "<img src=""images/07.jpg"" width=""56"" height=""97"" alt="lit candle">"Else Response.Write "<img src=""images/UNLIT_07.jpg"" width=""56"" height=""97"" alt=""unlit candle"">" End If %> ...

View Replies View Related

Sub And For Next Loop

I have a SUB which has input variables. If I run it once its okay, but I need to include it in a for....next loop. Can this be done ?

for i=0 to 100
call mySub(arr(0,i))
next

sub mySub(var)
.....code
end sub

View Replies View Related

RS Loop

I am getting this error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]Numeric value out of range
(null)
/database/data_entry.asp, line 90

Line 90 is shown below...

// count the total records by iterating through the recordset
for (rsProducts_total=0; !rsProducts.EOF; rsProducts.MoveNext())
{ <---- Line 90
rsProducts_total++;
}

This is an access database, connected to via a DSN. Any help will be muchly appreciated! I'm stuck on this one.

View Replies View Related

For Next Loop

I'm using three loops on a page and would like to set the loops individually to start at either 0 or -1 based on a condition. As an example, I would want the loop to start at either -1 as shown or 0.

Dim r
For r = --1 to Session("TotalRowsF")

code...

Next

Or, based on the condition it could be

Dim r
For r = 0 to Session("TotalRowsF")

code...

Next

View Replies View Related







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