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

xyz.qtc63355
xyz.qtc63355
onpaste="$(this).request('onFindAndAddProduct', {
                                      flash: 1,
                                      handleFlashMessage: function(message, type) {
    $.oc.flashMsg({ text: message, class: type })
},
                                      update: {   '{{ __SELF__ }}::productcard': '#productcard',
                                        '{{ __SELF__ }}::table': '#result'

                                              },
                                                        success: function(data) {
              this.success(data);
              $('#input-item').val('');
              $('#input-item').text('');
            }

Why "onpaste" doesnt pass value?

It works if I pass a custom data: data: { newItem: "21232312"},

How can I pass current input value in data?

Last updated

daftspunky
daftspunky

Make sure to wrap the elements in a <form> tag

xyz.qtc63355
xyz.qtc63355

Yes I did that but I think this is the problem: https://stackoverflow.com/questions/9045692/jquery-onpaste-for-the-first-time-doesnt-grab-or-pass-the-value

Do you have more examples for building front end forms with javascript?

daftspunky
daftspunky

The link provides a good solution!

I recommend the Watch and Learn series to learn more about building frontend forms with October. I have also made a note to explore this topic in our future educational videos

1-4 of 4

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