23
Views
13
Comments
Solved
How to clear cookies dynamically in reactive

Hello everyone 

In my reactive app I have some input fields. When I click in it

previous data appear like auto complete. I think it is coming from cookie if I am not wrong.

So how do I manage this? Is it any way to clear this cookie data dynamically?


Please help me



Thanks



dont wan to display the previous data entered....

Rank: #40021
Solution

Thanks for you reply,

The above condition is working fine....  Thanks.

But still i have to ask ?
as i have multipal  input in the single page and there are several pages in my reactive application.

Is there any option for global setting .?


Thanks

JK



Rank: #286
Solution

Hi JK2020,

You can stop this behaviour, just try to put following to the Attributes property of the required widgets as shown in screenshot.

autocomplete =“off”

 


Hope this helps, Thanks :)

Rank: #40021
Solution

Thanks for you reply,

The above condition is working fine....  Thanks.

But still i have to ask ?
as i have multipal  input in the single page and there are several pages in my reactive application.

Is there any option for global setting .?


Thanks

JK



Rank: #94

Hello JK2020,

Hope you're doing well.

Unfortunately, there is no global setting for your entire application. However, you should be able to do it for an entire page.

Can you please try to define the following JavaScript in your OnReady event?

var inputs = document.getElementsByTagName('input');
for(var i = 0; i < inputs.length; i++) {
    inputs[i].autocomplete = "off";
}


Let me know if it is working for you.


Kind regards,

Rui Barradas

Rank: #286

I'm agree with Rui's comment, if you have multiple type of input fields in your screen like text, numbers etc, then you can try with the below provided JS code.

Following js code works for every input type.

if (document.getElementsByTagName) {

var inputElements = document.getElementsByTagName("input");

for (i=0; inputElements[i]; i++) {


inputElements[i].setAttribute("autocomplete","off");


}

}

Thanks!!

Rank: #40021

I have one web page inside that i have 4 web blocks and in that 4 web blocks i have multiple inputs widgets.

Where should i apply this JS code..?

Can you help me on that as well.


Thanks 

JK  

Rank: #94

Hello JK2020,

You should apply it in the OnReady event of your screen (web page).


Kind regards,

Rui Barradas

Rank: #40021

Hi all , I really appreciate for your response.

Working:- 

"autocomplete =“off” "  The above mention code is working fine for me, but i have to implement this on every input section.


Not working:-

The below both the JS code i have tried simultaneously on web page "OnReady" function. even i have applied on web-blocks.  Still not working.

Am i doing something wrong.?

Is there is any another solution or different way of implantation,  if you can guide me on this it would be helpful.


Thanks

JK2020

Rank: #94

Hello again JK2020,

I did try a scenario where I have a screen with 2 blocks insite of it, each one of them with an input inside.

As far as I can tell, it is working as expected:


As you can see, for Block1 I have an input of type text and for Block2 I have an input of type number.

For both of them, the attribute autocomplete="off" was applied. I am using OnReady event.


I was considering that your inputs were static in the page.

What is probably happening is that you are rendering your Blocks dinamically. So, those inputs will render again. If this JavaScript is in your OnReady event, if they render again, they will lose that attribute.

Please consider to place that JavaScript in OnRender event instead, in the screen.


Let us know if it worked :)


Kind regards,

Rui Barradas

Rank: #40021

Hi all,

This code autocomplete="off"   is not working on my Text and Email Fields.

Also i have tried with your solution which you have mention in the above description (onRender)

 I have tried simultaneously both the JS code on web page  as well as on Web blocks on (OnRender) event. 

Tested one by one . 


Still my two of the inputs fields  Name and Email fields are having previous inputs data.

Even  autocomplete="off"  i have applied on the input fields not working on these two.

 

It would be helpful if you can suggests me on this.


Thanks.

Rank: #286

Hi JK2020,

I have created a web block with text and email input fields and it is working fine with autocomplete="off" as well as using javascript.

Could you please provide us a screenshot inspecting your fields by pressing F12 on browser? 


Thanks

Rank: #286

Just to know if it work, please try to set autocomplete = "false" for your text and email fields and let me know if it works :)

Thanks

Rank: #40021

Hi Shweta + Rui, 

Have you tested this code on CHROME Browner..?? for IE it is working fine , having no issue, but while testing on  Chrome it is ,

even i have clear browser history and then for the first time it is not displaying any previous data but for second time it is displayed.



i have applied JS code on both "OnReady" as well as "OnRender"  on both on Web screen and Web blocks Not working.


Thanks

Rank: #286

Yes, i'm also testing it on chrome browser only.

Could you please share a sample oml reproducing the same issue?