Chris__T
Posts: 339
|
Posted: 01/12/2009, 2:37 PM |
|
I was attempting to do this in javascript, but was told it would be better to user a ccdlookup() to check to see if a field value is filled instead of a control value, since the control value may or may not be hidden on the page. Here is that article: http://forums.codecharge.com/posts.php?post_id=102315
So I guess I want to try this through ASP, in a "before show" event for the form. On this form are several panels with text box in each of them. On loading this page, if a textbox is empty, then hide the panel (thus hiding the textbox) on page load. If a textbox is not empty, then do not hide the panel.
(most of this is psuedocode)
dim checkvalue
checkvalue = CCDLookUp("Inspector1", "permit", "Permit_ID=" &_
DBMYSQL5_1PERMIT.ToSQL(CCGetFromGet(Permit_ID), ccsInteger) , DBMYSQL5_1PERMIT)
if checkvalue <> 0 then 'ie, the lookup found a value in the field
panel is not hidden
else
panel is hidden
For my lookup, "inspector1" is the field i want to see if it is empty or not, "permit" is the table, and I guess I look based upon my form's current record it has open, which would be denoted by the Permit_ID. I'm pretty sure I didn't do the CCGetFromGet() right.
anyone point me in the right direction?
|
|
|
Oper
Posts: 1195
|
Posted: 01/14/2009, 2:38 PM |
|
under ccdlookup put this:
response.write "*" & CCGetFromGet(Permit_ID) & "<br>"
response.write "*" & checkvalue & "<br>"
response.end
posiblity to get an error
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
Chris__T
Posts: 339
|
Posted: 01/15/2009, 8:21 AM |
|
That doesn't work. So I commented out the CCDLookup stuff and just ran it with a checkvalue = "hello" and that brought up the response.write.
I tried checkvalue = CCGetFromGet(Permit_ID), then the response.write for that, and nothing happened either.
|
|
|
Oper
Posts: 1195
|
Posted: 01/15/2009, 1:59 PM |
|
white screen come up?
then both value are empty
try response.write with:
"Permit_ID=" & DBMYSQL5_1PERMIT.ToSQL(CCGetFromGet(Permit_ID), ccsInteger)
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
Chris__T
|
Posted: 01/16/2009, 8:52 AM |
|
Yeah, it was white screen.
I tried this:
dim checkvalue
checkvalue = "hello"
response.write "*" & checkvalue & "<br>"
response.write "Permit_ID=" &
DBMYSQL5_1PERMIT.ToSQL(CCGetFromGet(Permit_ID),ccsInteger)
response.end
It shows the *hello but nothing else.
Here is my URL: http://ccnet-appserver/permit/test2008/maintabstest2008.asp?Permit_ID=11745
so it should be pulling 11745
---------------------------------------
Sent from YesSoftware forum http://forums.codecharge.com/
|
|
|
Oper
|
Posted: 01/16/2009, 10:42 AM |
|
Chrish after teh hello at least should appear something like that:
Permit_ID=
_________________
_____________ http://www.7bz.com (Free CMS,CRM Developed in CCS) http://www.GlobalDevelop.com
Flash + CCS - Samples
(SWISHMAX + CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates & Free Stuff
Please do backup first
---------------------------------------
Sent from YesSoftware forum http://forums.yessoftware.com/
|
|
|
Chris__T
|
Posted: 01/16/2009, 1:48 PM |
|
Ah, the quotes and 2nd parameter in CCGetFromGet() worked. Thanks Oper.
Now I can try the lookup and see what errors I get there!
---------------------------------------
Sent from YesSoftware forum http://forums.codecharge.com/
|
|
|
Chris__T
|
Posted: 01/16/2009, 1:52 PM |
|
Oh sweet. The CCDLookup worked! Thanks for all the help Oper!
Now hopefully I can get this to check to see if a textbox is empty.
Thanks again!
---------------------------------------
Sent from YesSoftware forum http://forums.codecharge.com/
|
|
|
Oper
Posts: 1195
|
Posted: 01/19/2009, 4:59 AM |
|
Nice :)
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
Chris__T
Posts: 339
|
Posted: 01/19/2009, 11:18 AM |
|
Now I'm trying to figure out how to do the IF - THEN (ex. If textbox is empty , hide panel)
checkvalue = CCDLookUp("Inspector1", "permit", "Permit_ID=" &_
DBMYSQL5_1PERMIT.ToSQL(CCGetFromGet("Permit_ID",0), ccsInteger) , DBMYSQL5_1PERMIT)
works on it's own. It looks up the Permit_ID and returns whatever is in the Inspector1 field
So checkvalue could be "Jim White" or it could be " " (empty)
So I'm trying to do my if-then like this:
if (checkvalue <> " ") then
hide panel
else
show panel (or do nothing, since page loads to the default of showing panel)
end if
But it isn't working and I have a feeling that you can't use <> " " to check to see if a variable is empty or not
|
|
|
Chris__T
Posts: 339
|
Posted: 01/19/2009, 11:38 AM |
|
I did get this to work correctly with this:
if (checkvalue = Empty) then
... etc...
I just need to figure out the code for hiding panels.
|
|
|
Chris__T
Posts: 339
|
Posted: 01/19/2009, 12:43 PM |
|
Well, I got it to work. Kinda. If the inspector1 field is empty in the database, then the panel is not visible when the page loads. But my buttons to hide/unhide the panel on the page (through javascript) don't work, because I used VB script to hide the panel, and I guess it only uses VBscript to show the panel. But then if I do it that way, you can't hide/show the panel client-side via vbscript.
But if I hide/show via javascript client-side, I can't do my ccdlookup to see if the database field is empty or not to show/hide the panel on page load. Grrrrrr :)
|
|
|
Oper
Posts: 1195
|
Posted: 01/19/2009, 1:29 PM |
|
if you want to hide with a button only whne that field on the database is empty
small trick you can do is create a hidden field somewhere with the value of that field
with the ccdlookup (server side)
but now willbe easy form the client side cuase you coudl check if that hidden field value.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
|
|
Chris__T
Posts: 339
|
Posted: 01/19/2009, 1:52 PM |
|
Ah, that is tricky! I will have to try that and will report on my status! THanks OPER!
|
|
|