text disappears after clicking submit and value is empty

550 views
Skip to first unread message

TENSHI

unread,
Feb 25, 2022, 4:29:01 AM2/25/22
to chrome-...@googlegroups.com
Hello sir, your extension is awesome I tried to write a simple code with JS which is inputting a coupon code of my choice in the coupon input on Aliexpress.com at checkout, But the problem is that the text (coupon code) disappears and even if it stays, when I press apply button, nothing happens, and when I check the element in question, there is no value there, although it displays.I couldn't figure out how did you do it. So, how did you bypass this problem?
After searching the forum, I think it's a React bug.
here is a video simulating the problem: https://drive.google.com/file/d/1RfuJaPtuDVm3HAWy5p5Xl2zx46NQPuu_/view?usp=sharing
Thank you,

Autofill Extension

unread,
Feb 25, 2022, 6:08:33 PM2/25/22
to Autofill Extension
Yeah, React forms are a different beast since they maintain their own states, so assigning value to the inputs may not work.

What you can do is try experimenting with firing different events to see if it the coupon field is entered properly. Here's a sample JS rule:

let coupon = document.querySelector('#some-coupon-field');
if (coupon) {
  coupon.focus();
  coupon.value = 'COUPON_CODE';
  coupon.dispatchEvent(new Event('input'));
  coupon.blur();
}

If firing 'input' event alone doesn't work, then try firing other events like change, keyup, keydown, and keypress. Depending on what event handlers are used in the form, it may require a combination of these events, or possibly all of them being fired.

TENSHI

unread,
Mar 4, 2022, 9:59:29 AM3/4/22
to Autofill Extension
I tried it and it did not work, sir. 
can you please see where the problem is in the website at the checkout section?
Aliexpress.com
I would be very thankfull.
thank you,

TENSHI

unread,
Mar 4, 2022, 10:27:41 AM3/4/22
to Autofill Extension
and here is another video:
https://drive.google.com/file/d/16prw_wPHYDxTri1HyzRn5-UgsqmZNgOr/view?usp=sharing
you can see that apply button is not functional
and the input value is empty although the field is populated.

TENSHI

unread,
Mar 7, 2022, 6:31:06 PM3/7/22
to Autofill Extension
Please help me, sir. I will pay if you want, sir.
I have searched all forums, but didn't find the solution!! 
Reply all
Reply to author
Forward
0 new messages