kangus
|
| Posted: 08/16/2002, 1:34 AM |
|
I have been fighting this issue for three days now and CCS support has not replied to my support request. I've used what examples I could find and they all result in the form with the data element I'm trying to validate having it's method changed from POST to {Access}, then breaking. CCS inserts the javascript tag and loads the function.js file but never writes any code to call any function out of function.js.
|
|
|
 |
CC Support
|
| Posted: 08/16/2002, 4:12 AM |
|
Please don't put it like support doesn't request for 3 days.
It's just you've been fighting it for 3 days and in the end posted a request 
So there is incorrect presupposition in your message.
Please check out the support response in the support system.
|
|
|
 |
kangus
|
| Posted: 08/16/2002, 10:27 AM |
|
I checked when I first posted this problem and your right, I had ran across it on the 14th and started working on it, on the 15th at 17:00 I posted to support my request for help. Here's the history of the Validate issue: http://support.codecharge.com/usrCaseResponses.asp?case...angus@acats.com
My comment on support was not correct, you have responded but as of 8/16 the "Warning: Action style sheet is not found" problem has not been resolved.
On the upside I learned how to use the Properties : Format : <INPUT> : Events to add custom javascript to elements on a form. Now instead of hand coding the HTML view with onchange=vaildateMe(document.all.zip.value) I add vaildateMe(document.all.zip.value) to the onchange event.
In the scope of things three days to resolve a question is nothing, the problem is I promised to have a simple site up in 48 hours, I based this on the ability to generate code with client and server side validation using CCS.
|
|
|
 |
Alex Alexapolsky
|
| Posted: 08/19/2002, 4:19 AM |
|
Here an example how this can be done :
1) Open BugTrack example/BugTrack Form
2) Select Bug Name field/Events tab/Client/OnChange
3) Add Validate Minimum Length action , set control name,error message
and minimum length in action properties
4) View live page and try to enter some value below minumal.
Note : you can't use validate entry for onchange event.
|
|
|
 |
kangus
|
| Posted: 08/19/2002, 4:54 PM |
|
|
|
|
 |
kangus
|
| Posted: 08/19/2002, 4:54 PM |
|
Sorry about the previous reply, I hit enter instead of tab to get to the message area, good use of user validation _______________________
I tried as Alex suggested, it worked using the Forum example;
Now try to add Regular Expression Validation to Author, we want to check that the user has entered a first and last name, Proper case (upper case letter in the first character position) with a minimum length of 2, 2 or more letters in the last name with proper case, no digits or special characters allowed. I added that to the On Keypress event as the On Change event allows you to tab pass a required field:
I added the RegExp string and error message then clicked on Live Page (or hit F8) and got this error:
Generating Common Files
Warning: Action style sheet is not found.
Generating "NewThread"
Warning: Action style sheet is not found.
Generating "Header"
Warning: Action style sheet is not found.
Generating "Footer"
Warning: Action style sheet is not found.
Publishing to "O:\forum"
I tried to 'Move' from the On Keypress event to the On Change event but the application froze. I had to kill it with the task manager. (This program is not Responding): After I restarted CodeCharge Studio I find that even after I clicked on the disk ICON before going 'Live' nothing that I did during the session was saved, I had to fix my DB connection and the event handler was gone. What do the Disk ICONs on the tool bar do?
The On Change event does not happen if the user tabs by the field. If the field is not marked as required on the Data :textbox:topic the user is gets no message...... The On Change Validate Entry event does not work, I setup all the fields but nothing happens 'On Change or after Submit' (this was my reply to AA before I posted to this forum, I noticed that AA has found the same problem with Validate Entry).
Using the On Change and Custom Code I end up with:
function page_messages_author_OnChange()
{
var result = true;
//End page_messages_author_OnChange
//Custom Code @24-2A29BDB7
var reg_exp = /^([A-Z]{1}[a-z]{1,10}) ([A-Z]{1}[a-z]{1,10})|([A-Z]{1}[a-z]{1,10})$/;
if(!reg_exp.test(document.messages.author.value)) {
alert("You must have an Author in Proper Case\n Firstname Lastname 2~10 characters long\n or Authorsname as one word")
document.messages.author.focus();
document.messages.author.select();
unset(reg_exp);
return false;
}
//End Custom Code
//Close page_messages_author_OnChange @10-BC33A33A
unset(reg_exp);
return result;
}
//End Close page_messages_author_OnChange
This results in the validation of the authors name BUT ONLY if the user does not TAB pass the field.
To the table.xml file in the Components folder add:
<Event name="BeforeShow" caption="Before Show" description="Before showing control. Sample use: Change control value."/>
<Event name="OnKeyPress" caption="On Key Press" type="Client"/>
<Event name="OnLoad" caption="On Load" type="Client"/>
<Event name="OnChange" caption="On Change" type="Client"/>
<Event name="OnBlur" caption="On Blur" type="Client"/>
<Event name="OnClick" caption="On Click" type="Client"/>
<Event name="OnDblClick" caption="On DblClick" type="Client"/>
<Event name="OnKeyDown" caption="On OnKeyDown" type="Client"/>
Then restart CodeCharge, delete the existing events and create them using OnBlur and everything works like a real application!
I have created 800 lines of validate code based on validatePhone(name,value,mode,required) which allows me to pass a element to my function and display error messages based on the mode: xxx-xxxx mode 1, xxxxxxx mode 2, xxxxxxxxxx mode 3.. to mode 10 for phone. Postal Code has 8 modes, Money has 8 modes, precent has 5 modes.....
Make sure that your functions are added to the functions.js file using CCS in edit mode, go to the end of the file and append your functions. I edited the functions.js external of CCS and CCS replaced it with the standard functions.js
Note: The "Action style sheet is not found" problem is still there and I have not gotten an anwser as to why... Why doesn't Validate Entry work? It has Min-Max RegExp Required -- All the items you need yet when you use it you get the Action....... error.
|
|
|
 |
kangus
|
| Posted: 08/19/2002, 5:22 PM |
|
The file name to edit is C:\CodeChargeStudio\Components\TextBox.xml NOT C:\CodeChargeStudio\Components\Table.xml... there is no Table.xml file.
|
|
|
 |
|