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.
I am using this code to validat a checkbox in a very big file, the problem is,its not validating:
here is my code function checkAgree(theform){ if(theform.Agreement.checked == false){ alert("Please tick the checkbox to continue."); theform.Agreement.focus(); return false; } }
I am trying to what seems simple but can not get it to work. I am using Ultradev 4
I have a form that uses a checkbox to indicate weather a call has been closed or not. However if the call has been closed then I need a resolution text field to contain data. ie: If checkbox selected then resolution textfield can't be empty.
I've tried yaromats check form extension but it DOES NOT work as I am using a multiline text field. The extension works for a sinle line textfield but not a multiline.. I don't know why?
As a result I don't get the option to select this field using the "This must be checked to" option in Yaromats extension.
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.
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.
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.
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:
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.
I have a little code to add multiple items to a shopping cart based page. This code works perfect, but it adds all of the info to the same input fields every time it loops. I need it to change the input names each time it loops. Here is the code:
I have a date entry on a form that must be at least 30 days from the current date. It is a delivery request date and the soonest it can be processed is 30 days from the request. I need code to validate and message should they enter a date less than 30 days from the current date.
I've been given a task to write an function to validate URL's used on a website. The URL's are going to be kept in a table with other fields to indicate if the URL is valid and when it was last validated.
Any URL's that aren't valid won't be displayed on the site. Is there a way in ASP to check if any given URL returns a 404 error?
I have created one of those change your password forms whereby the the old password and new password are provided.
What I am having trouble with is ensuring that the old password entered actually exists already. Below is what I have tried, but I am getting a syntax error:
Code:
'Check Password
if request.form("CusPassword")<>rsCheckUser.fields("CustomerPassword") then
response.write "Invalid password"
end if
Else
if request.form("CusPassword")= rsCheckUser.fields("CustomerPassword") then
'write new password to databasestrSQL ="UPDATE Customer Set CustomerPassword ='"& NewPassword& "',CustomerPasswordverified ='"& NewPassword& "' where CustomerEmail = '"&CusEmail&"' "
I have a form which consists of a few fields. The problem that i encountered was it seemed like just checking the first field only rather than all the fields. Code:
I am looking for a way to do a validation in the form that who ever is filling the form is a true person & not a automatic system. there is a way to do it with letters in an image & the user must enter the same letters in a text field.
I am wondering if there is a way to validate a user's login from 2 different tables. Currently I have a sql string that pull info from a table based on the users login and password.Code:
sqlStr = "Select * From authorised_user_table where username = '" & Request.Form("username") & "' and password = '" & Request.Form("password") & "'"
My problem is I the passwords in this table are old, and I have a new table with all new passwords (same structure, just different passwords). I'm thinking most of the users don't remember their new passwords just the old. So is there a way I can query both tables? Something like Select * from table1..... else Select * from table2
I once saw somewhere, and I cannot recall the site / article... But I believe there is a way that you can "Check" an E-Mail Address to make sure that it is a Valid Email Address. NOT Syntax checking... But to actually determine if the email address typed in is a "Real" and "Active" E-Mail Address.
I realize this is not solely an ASP question, but I thought you guys might know the answer and I couldn't find anywhere else to post this. If you have suggestions for this I am more than happy to post somewhere else.
How can I, using ASP code, validate whether or not an email address is a real one? For example, if I have the email address called Join Bytes! how can I determine if it is real?
A form is passing "firstName" and "lastName" to your ASP page.show code how to validate them server side validation as follows:Only Alphanumeric characters,commas,hypens, spaces or periods are allowed in the last name.
Only A-Z, the hyphen are allowed in the first name.Both fields must be provided.Return a string value from your validation indicating to the user what is wrong with their entry. "
I have 2 fields on a form called 'name' and 'title'.
I want to make the 'name' field compulsory to fill in on a form. So if someone submits a form and the name field is not filled in, it will tell them and won't let them submit.
But I only want the name field to become compulsory when the 'title' field is filled in. So if the title filed is blank then the validation will not be effective but if the title field is filled in then the name field will become compulsory. Code:
I just realized that it's so important to validate each string, I mean 'each' before you insert data from asp page into database.
I guess some customers just copy data from some electronic document and paste intoform field which it will probably mess up the program.
for example, we have a customer who wants to enter AH12345 into one of our fields, it appears Ð?Ð?12345 in hidden field of our asp page, but it displayed AH12345 to the customer, but our program failed because of the data does fit into char field in sql database.
I don't know in reality, how other companies deal with those kind of thing. Do I have write our own regExp to validate each string, since we do need to allow apostrophe or "-" in first name or last name.
I have functions with which i can validate a URL from serverside. But, i need to valide the URL at the Client side (ASP- Javascript) itself. Is there any way to validate a given URL from the Client side.