CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 TEXT AREA MaxLength

Print topic Send  topic

Author Message
Justman
Posted: 12/29/2004, 12:21 AM

Hi ,

I'm looking for a way to limit the number of charcters for TextArea field in a record form.

Has anyone be able to set maxlength value for TEXTAREA field in CCS? Please let me know.

Cheers,
Justman


peterr


Posts: 5971
Posted: 12/29/2004, 1:23 AM

Please see http://forums.codecharge.com/posts.php?post_id=54841
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Justman
Posted: 12/29/2004, 3:39 AM

Hi Peterr,

Thanks for the web link. I can see different codes that can limit the number characters for TEXTAREA control. But trying to use this functions with CCS generated code for TEXTAREA is proving a little bit hard. A common problem with all code generators ( CCS is far better than most that I have used!)

I have enclosed the codes below, hopefully you maybe able to identify what needs to be done to get it working with CCS TEXTAREA (code included as well).


<script type="text/javascript">
function validatePage(form) {
return (
detectWrap(form.elements["myTextArea"])
)
}
function detectWrap(formField) {
var length = formField.value.length;
var value = formField.value;
var linesAllowed = 6; // number of line breaks allowed
var i; // int counter for for loop
var lineBreakCount = 0; // counter for line breaks

for (i=0; i<=length; i++) {
var myRegExp = /\n/

// test to see if the char being tested is a return
if (myRegExp.test(value.charAt(i))) {
// char is a line break so increment var
lineBreakCount += 1;
}

// one break is always detected at the beginning so increment by 1
var lineBreaksDetected = lineBreakCount + 1

// if number of line breaks is too large
if ( lineBreaksDetected > linesAllowed) {
alert("too many lines. You have over " + linesAllowed + " lines and are only allowed " + linesAllowed);
return false;
}
}

// if the loop didn't return a false value, return true
return true;
}
</script>



CCS TEXTAREA SECTION

<td class="brightDataTD"> <textarea class="brightTextarea" style="WIDTH: 248px; HEIGHT: 85px" name="{memo_desc_Name}" rows="4" wrap="hard" cols="4" onchange="detectWrap(this);">{memo_desc}</textarea></td>




Quote peterr:
peterr


Posts: 5971
Posted: 12/29/2004, 12:08 PM

Hi,

Let me point that CCS doesn't generate HTML. I mean the builders create it but you can edit or replace the HTML, or even use other Web editors like FrontPage or Dreamweaver to edit the HTML. The HTML is a template that is later used by the generated application to output the page. Therefore I'm assuming that you can adapt either the HTML or JavaScript however necessary.
Unfortunately I am not familiar with JavaScript. If no one else helps here I can only recommend that you create a working example without CCS, then once you have it working you can copy it into CCS.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Justman
Posted: 12/29/2004, 3:01 PM

Hi Peterr,

CCS is a great product . There's no question about it and I have decided to use it for a long time.

But my concern is that trying to distinguish "generate" from "create" in this instance is like trying to bend my arms with scalf over my face to agree to your comments in paragraph of your response.

Which seems to counteract my opinion about code generators. Isn't the builders part of the application?+, When you use the builders through the wizards to build software, what does it output in the underlying files? + My point is that the process of making changes to "generated" or "created" (whichever term you want to use) code, can sometimes exhaust the time saved by using code builders.

Having made my point, does not suggest that manual hand coding is better, its even worse! So, we just have to find a better way to solving little issues like the TEXTAREA issue to maximize the benefits derived from using code builders.

Happy New Year in advance peterr.

Cheers,
Justman


Quote peterr:
Hi,

Let me point that CCS doesn't generate HTML. I mean the builders create it but you can edit or replace the HTML, or even use other Web editors like FrontPage or Dreamweaver to edit the HTML. The HTML is a template that is later used by the generated application to output the page. Therefore I'm assuming that you can adapt either the HTML or JavaScript however necessary.
Unfortunately I am not familiar with JavaScript. If no one else helps here I can only recommend that you create a working example without CCS, then once you have it working you can copy it into CCS.
peterr


Posts: 5971
Posted: 12/29/2004, 3:31 PM

Got it. I was only little concerned that you may be thinking that HTML is generated during publishing (like the code) and may be modified by CCS during such generation.
And thanks, Happy New Year to you too!
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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