This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

at10439
at10439

Hi there,

do you have any idea why AJAX DATA API doesn't call function onEdit() when typing in some text into description field <textarea name="description" data-track-input data-request="onEdit"></textarea>

while <input name="title" type="text" data-track-input data-request="onEdit"> does ?

thanks in advance for your kind support. best, Alexander

Last updated

joseph.w.crowell30463
joseph.w.crowell30463

textareas have a different set of calls from inputs.

Last updated

at10439
at10439

joseph.w.crowell30463 said:

textareas have a different set of calls from inputs.

of course, but why did data-track-input do not work on textareas ?

mjauvin
mjauvin

data-track-input

can be applied to a text, number, or password input field that also has the data-request attribute. When defined, the input field automatically sends an AJAX request when a user types something in the field. The optional attribute value can define the interval, in milliseconds, the framework waits before it sends the requests.

ref. https://octobercms.com/docs/ajax/attributes-api

at10439
at10439

mjauvin said:

data-track-input

can be applied to a text, number, or password input field that also has the data-request attribute. When defined, the input field automatically sends an AJAX request when a user types something in the field. The optional attribute value can define the interval, in milliseconds, the framework waits before it sends the requests.

ref. https://octobercms.com/docs/ajax/attributes-api

thanks so far for that reference. I already checked this out. Current AJAX DATA API works fine for elements like <select>, <input> etc... it does not work for <input type="date">, <input type="time"> or even <textarea>. This leads me to conclusion that there might be some defects in October's DATA / JS API implementation for those form elements. How do you manage to forward data entry from textarea elements into data models.

I would like to have somelike

<textarea name="description" data-request="onTypeAhead" data-track-input="5">{{ record.description}}</textarea

....

function onTypeAhead(){ $entry = input('description'); $record->(['description' => $entry]); $this['record'] = $record; }

just to record every keystroke into the data model

mjauvin
mjauvin

Just use Javascript I guess.

1-6 of 6

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.