CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 check_and_bind not defined

Print topic Send  topic

Author Message
flipandboef


Posts: 107
Posted: 02/24/2011, 10:18 AM

This is driving me nuts!
I created a new page, used the Record Builder
Selected the table to use, added fields I needed and set the key.
Selected the buttons delete with confirmation and the cancel button to be included.
That's all --> made no changes to html / code / etc

Now after publishing the page, I get the JS error:
check_and_bind is not defined (line 32)

Line 32 is:
    if (document.forms["FAQs"])check_and_bind('document.forms["FAQs"].Button_Delete','onclick',page_FAQs_Button_Delete_OnClick);  

The complete section of the script generated by CCS:
<script language="JavaScript" type="text/javascript">  
//End Include JSFunctions  
  
//page_FAQs_Button_Delete_OnClick @5-2023DF82  
function page_FAQs_Button_Delete_OnClick()  
{  
    var result;  
//End page_FAQs_Button_Delete_OnClick  
  
//Confirmation Message @6-8243B274  
    return confirm('Delete record?');  
//End Confirmation Message  
  
//Close page_FAQs_Button_Delete_OnClick @5-BC33A33A  
    return result;  
}  
//End Close page_FAQs_Button_Delete_OnClick  
  
//bind_events @1-C76511EB  
function bind_events() {  
    if (document.forms["FAQs"])check_and_bind('document.forms["FAQs"].Button_Delete','onclick',page_FAQs_Button_Delete_OnClick);  
    forms_onload();  
}  
//End bind_events  
  
window.onload = bind_events; //Assign bind_events @1-19F7B649  
  
//End CCS script  
</script>  

Ignoring the error, it does function, except the confirmation message on the Delete button

----------- EDIT ---------------
Hmmmm discovered something....
When I take out the Confirm on the Delete button, the error is gone...
So decided let's manually add this again:
Selected the Delete button, in the Events went to On Click, Add Action, Confirmation Message and entered some text....
Yup the error is back, but worse, it ignores the error and deletes the record!!!
Not being an ASP-brain, I have no idea how to get this confirmation to work now... :(

Also when I leave the Confirmation message out (for testing), and I add the fckeditor, guess what:
Same error appears again!
This time on this line:
if (document.forms["FAQs"])check_and_bind('document.forms["FAQs"].TextArea1','onLoad',page_FAQs_TextArea1_OnLoad);

done this so many times in the past, where BOTH delete button and fckeditor are behaving normal...
So I really do not understand why it's giving me issues on this one.

Any help would really be appreciated! ;)

------------
using CCS version 3.2.0.6 / ASP with templates / Access DB
View profile  Send private message
andrewi

Posts: 162
Posted: 02/25/2011, 1:38 PM

the function check_and_bind() is defined in a javascript function file called functions.js (at least in version 4.3, but it will be similar in other versions).

In the HTML you should see a line like the following which refers to the function.js file.

<script language="JavaScript" src="../ClientI18N.asp?file=Functions.js&locale=en" type="text/javascript" charset="utf-8"></script>

Try publishing the entire project again to make sure all the function library files have been deployed.
View profile  Send private message
flipandboef


Posts: 107
Posted: 02/25/2011, 1:55 PM

Thanks for your responds,
I actually have done this severeal times, as well as completely redoing the page.
Did not help :(
Any further suggestions?
View profile  Send private message
andrewi

Posts: 162
Posted: 02/25/2011, 3:37 PM

Well, do you have the reference including "Functions.js" , similar to above, in the page's HTML?

If so, does the path resolve - can you download the file Functions.js from the location specified? If you load the page in Firefox and view the source, the path to the linked file is a hyperlink and you can view it.

My thought is that the script reference isn't complete, or the file path is wrong or the file is inaccessible for some reason or other.
View profile  Send private message
flipandboef


Posts: 107
Posted: 02/28/2011, 9:44 AM

Double checked it, as it might have been a good suggestion, but....
Afraid the file is there / accessable / etc....

Thanks so much on trying to help me on this issue ;)
Any other thoughts?
View profile  Send private message
flipandboef


Posts: 107
Posted: 03/01/2011, 11:54 AM

Did a little more testing...

I removed the line:
<script language="JavaScript" type="text/javascript" charset="utf-8" src="ClientI18N.asp?file=Functions.js&locale=en"></script> 

and copied the content of the Functions.js into the html code itself...
Behold: no errors and good behavior!

So what I do not understand is: what's going wrong?
As mentioned when looking at the source (via FireFox), the Functions.js is mentioned in this line:
<script language="JavaScript" type="text/javascript" charset="utf-8" src="ClientI18N.asp?file=Functions.js&locale=en"></script>

Click on it, and I see the code of Functions.js as expected.
This would indicate to me, that the link to the file works fine and that the functions should be able to be called...

Soooo confused! :-(

---- EDIT ----
One thing I did not noticed:
The page is restricted.. On the login-screen, I also get a js-error:
forms_onload is not defined

I'm assuming this is related?
View profile  Send private message
andrewi

Posts: 162
Posted: 03/01/2011, 4:13 PM

I think that is related. It does look like something is preventing Javascript from seeing those function definitions, even though the path to them seems correct.

These function calls are fairly basic to CCS and generally just... work. I've never known them to go wrong, unless I accidentally change something.

You could try the usual steps of creating a brand new, toy CCS application with just a simple form with a couple of client events. If that works, then you know that CCS itself is OK, it's just the application (or a page within it) that's got a problem. It the new app doesn't work, then Yes support would seem necessary.

View profile  Send private message
Oper


Posts: 1195
Posted: 03/05/2011, 3:21 PM

Could you post the full HTML?

_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
flipandboef


Posts: 107
Posted: 03/07/2011, 7:20 AM

If you want,
I have made a new project, just to test this out, but also here I have this error.
I have added the (test) project with the access DB on our server, so feel free to download and look at it, if you think you could help me on this issue...
The zippped file is only about 76Kb and you can get it from:
http://www.worldofrugs.com/files/intra2.zip

Thanks for your help!
View profile  Send private message
flipandboef


Posts: 107
Posted: 03/09/2011, 6:49 AM

The support team actually looked into this for me a little (thanks to Greg! ;-))
They found no issues with my project when they tested my project ??

Yet I still have the issue!
It somehow either is within this line:
<script language="JavaScript" src="ClientI18N.asp?file=Functions.js&locale={res:CCS_LocaleID}" type="text/javascript" charset="utf-8"></script>

When altering this line to:
<script language="JavaScript" src="Functions.js" type="text/javascript" charset="utf-8"></script>
it behaves a it should be!

So is something wrong with this line OR perhaps with the ClientI18N.asp file?
I compared it to another project that works fine, and they look the same....
Sooo confused :-<

As mentioned, I have tried serveral times to create a whole new project and published it, even in a new folder on the web-server, but this error does not go away...
View profile  Send private message
flipandboef


Posts: 107
Posted: 03/10/2011, 1:22 PM

Also:
Have a look at the following screenshots below:

I created those screen-shots, when creating a grid on a blank / new page in CCS.

I cannot recall the red-circled parts looking like this?
I guess this is related to the error as well?




View profile  Send private message
andrewi

Posts: 162
Posted: 03/11/2011, 11:05 AM

You see those codes because on step 1 of the wizard "Internationalized (use translation resources {res:...} etc)" was checked/ticked. (that's not a bad thing - I think the Internationalization features are a great help - even if you never intend to use more than one language).

The script reference to "ClientI18N.asp" mentioned above is related to Internationalisation ("I18N" = "Internationalization"). This file returns a version of Functions.jsp to match the browser's locale (though you can get good benefit even with just one language option).

So, go to Project --> Settings, Select "Locales & Encodings" and check that "Use Internationalization Features" is ticked. Then republish whole site & see if that helps.
View profile  Send private message
apata

Posts: 7
Posted: 03/17/2011, 4:53 AM

andrewi, please could you send me your email atemjosh@ymail.com? I would need your assistance in a project i am undertaking at the moment which you will definitely be paid for.
View profile  Send private message
TheunisP

Posts: 342
Posted: 03/17/2011, 5:10 AM

do you still have this issue? and want to confirm the project is in CCS 3.2.06?

View profile  Send private message
flipandboef


Posts: 107
Posted: 03/17/2011, 6:24 AM

The issue on the screen-shots is gone, thanks to the explenation from Andrewi!
Thanks for that :-) (and sorry for the delayed response)

@TheunisP

Yes, I'm afraid I still have the issue and indeed the version is: 3.2.0.6

I adjusted the line:
<script language="JavaScript" src="ClientI18N.asp?file=Functions.js&locale={res:CCS_LocaleID}" type="text/javascript" charset="utf-8"></script>
to:
<script language="JavaScript" src="Functions.js" type="text/javascript" charset="utf-8"></script>
and this resolved the error, but of cos. this should not be needed to do in my opinion?
View profile  Send private message
TheunisP

Posts: 342
Posted: 03/17/2011, 7:32 AM

ok - then me compiling it would be futile - can you zip up the resulting code with a vpath to the access db - so I need the aps, html, js etc and the db in a zip in the correct folders - so I can just unzip and test

I have a couple of hours - so let see if we can sort it
View profile  Send private message
flipandboef


Posts: 107
Posted: 03/17/2011, 7:42 AM

Thank you sooooo much on willing to help me with this TheunisP!

The zippped file is only about 76Kb and you can get it from:
http://www.worldofrugs.com/files/intra2.zip

These are the Project files

My folder structure is as followed:

The project files (+DB) are on my Desktop -> Intra2

It published to c:\webserver\123\

I will upload a file shortly with the publised files for you.
View profile  Send private message
flipandboef


Posts: 107
Posted: 03/17/2011, 7:50 AM

Ok, the published files are ready...
Get them at:
http://www.worldofrugs.com/files/Published.zip

It's about 136Kb (including DB)
View profile  Send private message
TheunisP

Posts: 342
Posted: 03/17/2011, 7:51 AM

cool - waiting
View profile  Send private message
flipandboef


Posts: 107
Posted: 03/17/2011, 7:54 AM

Posted both: Project files and Publihed files Theunis
View profile  Send private message
TheunisP

Posts: 342
Posted: 03/17/2011, 7:58 AM

got it - unzipped - fixing db paths - hold on ...
View profile  Send private message
TheunisP

Posts: 342
Posted: 03/17/2011, 8:20 AM

ok i've found it it is not that js is not working it is never loaded, try and load the line below - just replace the 127 warra warra with your pc name and folder name

http://127.0.0.1/ClientI18N.asp?file=Functions.js&locale=en-US

this file clienta8n is suppose to load the js so that the functions are defined - you will notice it crashed - error is something pathtoroot not define - now the dirty fix is to uncomment the lines below in the c18n file they are at the bottom

Function PagePathToRoot
PagePathToRoot = "./"
End Function

but what it seems like is the project doesn't know where its root is - so check your project settings that you have the default site and folder defined

View profile  Send private message
TheunisP

Posts: 342
Posted: 03/17/2011, 8:29 AM

strange - I assume it might be a thing between versions - but in the newer CCS version the pathtoroot gets defined by classes.asp - which in turn gets called by common.asp which is one of the include files of the clientI18n page

so I'm not even sure why your pathtoroot is defined in clienti18n page unless, as said, older CCS' versions doesn't define it by default? so the next question is why was it commented out? was it ccs that commented it out?



View profile  Send private message
flipandboef


Posts: 107
Posted: 03/17/2011, 9:46 AM

TheunisP,
I deleted all files, to make sure no manual adjustments were left and republished...
Download it at:
http://www.worldofrugs.com/files/PublishedNew.zip

Those comments could have been made when I was playing with it before...
If it's still there, it's done by CCS


Thanks So Much for helping and willing to spend some time on this TheunisP!!!

---EDIT---
I also checked the settings, and they look good as far as I can tell...
View profile  Send private message
TheunisP

Posts: 342
Posted: 03/17/2011, 10:24 AM

** 1st ignore my pref ref it is NOT PathToRoot that causes the problem but PagePathToRoot - the PathToRoot is in the classes.asp and I found PagePathToRoot in the actual (calling) page's code

well, as said the uncommenting the lines (inner 3 not the start and end comments) fixes the problem

'Function PagePathToRoot @0-FE5E6FF2
'Function PagePathToRoot
'PagePathToRoot = "./"
'End Function
'End Function PagePathToRoot

the easy fact is that the functions.js never gets loaded - the proof of concept is that ClientI18N.asp doesn't run, if you call it as below:

http://127.0.0.1/ClientI18N.asp?file=Functions.js&locale=en-US

it should display the JS code as it should be inserted into your page

the actual line that starts the mess:

.PathRes = Server.MapPath(PagePathToRoot)

just remember the calling page's PagePathToRoot is not exposed to the clienti18n we call since we use a javascript call so they don't share an environment

View profile  Send private message
TheunisP

Posts: 342
Posted: 03/17/2011, 10:28 AM

can you post the project 's Publishing settings dialog for me please?
View profile  Send private message
flipandboef


Posts: 107
Posted: 03/17/2011, 10:39 AM

Do you mean you want screenshot's of the settings?
(sorry, little confused what you need)
View profile  Send private message
TheunisP

Posts: 342
Posted: 03/17/2011, 10:40 AM

yes please, I know where the error is - just need to confirm it

project settings --> publishing and screen shot ;-)
View profile  Send private message
TheunisP

Posts: 342
Posted: 03/17/2011, 10:41 AM

ps. I also need the full address you type into the browser to view the page
View profile  Send private message
flipandboef


Posts: 107
Posted: 03/17/2011, 10:57 AM

The path in the browser would be:
http://intranet/123/CC_FaqMaint.asp

and here's the screen-shot:

View profile  Send private message
 Page 1 of 2  Next Last


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.