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
ADVERTISEMENT
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
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
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
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
How can I show a checkbox as checked based off of the variable stored in a database?
View Replies
View Related
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
View Related
how can i check if the radio button is checked or not in Asp .
View Replies
View Related
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
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
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
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
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
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
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
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