Discussions

Expand all | Collapse all

Add text to a text field without replacing the existing data and without the name - date stamping

  • 1.  Add text to a text field without replacing the existing data and without the name - date stamping

    Posted 11-01-2017 13:52
    How can I add text to a text field without replacing the existing data and without the name - date stamping ? (The data I want to add to text field is from Html page.)


  • 2.  RE: Add text to a text field without replacing the existing data and without the name - date stamping

    Posted 11-01-2017 14:12

    Do you want to import these changes or enter them one at a time using the form?

    If you want to import en masse such a change to a text field without overwriting what is currently there, you may need to use an intermediate formula text field, and, a new text field to import into.

    Can you provide your desired approach to making the edits to this text field?



  • 3.  RE: Add text to a text field without replacing the existing data and without the name - date stamping

    Posted 11-01-2017 14:58

    Ok, so I have to use an intermediate Formula Text Field and write a formula to replace the text inside square brackets along with the brackets with a comma. How can I achieve that?


  • 4.  RE: Add text to a text field without replacing the existing data and without the name - date stamping

    Posted 11-01-2017 16:00

    Let's say you have a field into which you import the additional text. Let's call it for now, [Additional Text]. << this is to be a normal, multi-line text field.

    Let's create a formula text field, [Text field plus additional text]. << This is a 'formula text' field.

    Inside the code for the formula text field, [Text field plus additional text], you will say,

    [my current text field] & " any separator characters " & [Additional Text]


    [My current text field] is whatever your current text field is whose "content" is to be appended to within your formula text field.

    Your import spreadsheet would import only into [Additional Text]. Not any of the other two text fields.

    You would create or modify existing reports using the formula text field, [Text field plus additional text]. In other words, your reports will use [Text field plus additional text].

    Your current already in use text field would be for normal single record form input.

    Does this make sense?




  • 5.  RE: Add text to a text field without replacing the existing data and without the name - date stamping

    Posted 11-01-2017 20:21
    In the image I shared; my multi-line text field (say [Data] ) already had data "John, Shawn, Josh". Then through the HTML page that I attached below, I add more data i.e. "6" and "9.2" to the same multi-line text field [Data] that gets added with date-name stamp. If I add more data i.e. "10"; it will get added to the same [Data] with date-time stamp and will look like this. 

    John, Shawn, Josh [NOV-01-17 karan-bhavsar] 6 [NOV-01-17 karan-bhavsar] 9.2 [NOV-01-17 karan-bhavsar] 10

    I want to replace the text inside square brackets along with the brackets with a comma so that I get this >> John, Shawn, Josh, 6, 9.2, 10

    How can I achieve this using formula text field.
    ")


  • 6.  RE: Add text to a text field without replacing the existing data and without the name - date stamping

    Posted 11-01-2017 21:01
    In the properties of the original text field, it looks like you have "Log edits to this field and show them on forms" checked. If you uncheck that property, you will not get the data in the square brackets.


  • 7.  RE: Add text to a text field without replacing the existing data and without the name - date stamping

    Posted 11-02-2017 14:52
    I am using Log edits so that when I click on Add button on HTML page, it appends the data to the data already present in the text field and not replace the existing data. 


  • 8.  RE: Add text to a text field without replacing the existing data and without the name - date stamping

    Posted 11-02-2017 14:54
    Okay, I thought you were taking a different direction, but it sounds like you want to keep log edits. I'm uncertain at this point what you wish to accomplish.


  • 9.  RE: Add text to a text field without replacing the existing data and without the name - date stamping

    Posted 11-03-2017 06:10
    I'd suggest making the 'additions' as child records.  You already have the html page set up to it'll be a breeze to make those as line items.

    "log edits" is really just a crutch for most cases and usually comes up against these types of limits often.


  • 10.  RE: Add text to a text field without replacing the existing data and without the name - date stamping

    Posted 11-03-2017 06:43
    When you edit a record there is a hidden <input> on the form for every field which records the "old" value of the field. So for a field with fid=6 there is the visible <input> with id=_fid_6 and a hidden <input> with name=_fid_oval_6. So what you can do is modify the Save button click handler to first concatenate the value in hidden <input> with the value in the visible <input> and place this concatenated value into the visible <input> and then do the normal Save routine.

    Here  is the code to use with IOL that does the trick:

    var originalClickHandler = $("#saveButton").data("events").click[0].handler;
    $("#saveButton").unbind("click");
    $("#saveButton").on("click", function() {
      $("#_fid_6").val($("[name=_fid_oval_6]").val() + ", " + $("#_fid_6").val());
      originalClickHandler();
    });
    There is no need to use formulas or a child table. The behavior you want should be implemented directly on the form when the keystrokes are entered and the form is Saved.