If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Checkbox depending on another field. How ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-07-03, 02:36
pravetz pravetz is offline
Registered User
 
Join Date: Oct 2003
Posts: 3
Checkbox depending on another field. How ?

Hi,
My question is is there a way to make my checkbox dymanic. I want to do this: I have a date field where by default you see the current date I have some other fields and finaly I have a Confirmation field which is "Yes/No" field. The idea is that when someone enters data with todays date or past date the confirmation field must be set to Yes and if the date is in the future the checkbox must record No! Do you have any idea how this can be done

P.S. The confirmation field can be hidden it is not mandatory to be dynamicly changing on the page!

Thanks in advance,
Pravetz
Reply With Quote
  #2 (permalink)  
Old 10-07-03, 03:24
cyrus cyrus is offline
Registered User
 
Join Date: Oct 2003
Location: Pune
Posts: 59
You can do this by writing a javascript on some event of the text changes.
where u have to check the date in the function and depneding on the date change the value of your check box

cyrus
Reply With Quote
  #3 (permalink)  
Old 10-07-03, 03:47
pravetz pravetz is offline
Registered User
 
Join Date: Oct 2003
Posts: 3
how

Yeah I know that it can be done using JavaScript, but how exacly should this script look like? Anyone???
Now I'm working on another version using an IF statement in the asp script something like:
Code:
Date = Request.Form("Date")
If Date <= Date() Then
    rs("Confirmed") = true
Else
    rs("Confirmed") = false
End If
However it is not working right any ideas?
Reply With Quote
  #4 (permalink)  
Old 10-07-03, 04:07
pravetz pravetz is offline
Registered User
 
Join Date: Oct 2003
Posts: 3
I did iiiiiiiiiit :)

Ok I figured this out
it's something like this:
Code:
Date = Request.Form("Date")
rs("Date") = Date
If rs("Date") <= Date() Then
    rs("Confirmed") = true
Else
    rs("Confirmed") = false
End If
I am pasing only the code that is involved with my question so it may be a little confusing.
Reply With Quote
  #5 (permalink)  
Old 10-09-03, 00:30
cyrus cyrus is offline
Registered User
 
Join Date: Oct 2003
Location: Pune
Posts: 59
Smile

Good !!!!!!!!!


Congrats

Cyrus
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On