Forums: [SOLVED] Text Area and Placeholder Dimensions - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

[SOLVED] Text Area and Placeholder Dimensions Rate Topic: -----

#1 User is offline   Dave Cherrington 

  • Member
  • PipPip
  • Group: Members
  • Posts: 14
  • Joined: 03-August 18

Posted 09 January 2019 - 05:00 PM

I have been using ASPrunner.NET to create a series of input forms so that users can input data directly into my database. I am having an issue with a particular form that is used for users to write some narrative, which will go into my database as text (obviously) and be outputted into a text placeholder. Due to the nature of the final report, users need to limit the amount of text they write.

I use Text Area as the Edit As option, mainly as this wraps text and allows users to review what they have written easily. However, as I can't set a character limit on a text area, I set the placeholder size to specific dimensions to give the users an idea of what will fit into the final report. For example, my first field is on top (Narrative) and has a placeholder of 600px by 110px, and my second field is underneath (Actions) and has a placeholder of 480px by 380px.

In version 9.8 I am able to do this using a mixture of freeform mode and html, but I'm currently in the process of rebuilding the report up from scratch in version 10 and don't seem to able to recreate this functionality. Any tips to help me?
0

#2 User is offline   jadach 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 451
  • Joined: 26-April 08
  • Gender:Male
  • Location:New York

Posted 09 January 2019 - 06:59 PM

In this case, my text area field in the database is called Description. I want to set a max length allowed to 200.

For the add and edit pages, add the following to Javascript onload events. Change the field name to match yours.

var ctrlDescription = Runner.getControl(pageid,'Description');

ctrlDescription.on('keyup',function(e, argsArr){
var len = this.getValue().length;
if (len > 200) 
{
    alert("Maximum length allowed: 200.");
    this.setValue(this.getValue().substring(0, 200));
}
});

-jerry
0

#3 User is offline   Dave Cherrington 

  • Member
  • PipPip
  • Group: Members
  • Posts: 14
  • Joined: 03-August 18

Posted 10 January 2019 - 12:05 PM

View Postjadach, on 09 January 2019 - 06:59 PM, said:

In this case, my text area field in the database is called Description. I want to set a max length allowed to 200.

For the add and edit pages, add the following to Javascript onload events. Change the field name to match yours.

var ctrlDescription = Runner.getControl(pageid,'Description');

ctrlDescription.on('keyup',function(e, argsArr){
var len = this.getValue().length;
if (len > 200) 
{
    alert("Maximum length allowed: 200.");
    this.setValue(this.getValue().substring(0, 200));
}
});


Great, thanks Jerry. Not exactly what I was going for, but it is actually what the requirement was when I originally started the project.

I can make this work. Thanks very much!
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users