0
Hello,
I wonder if there is a way to brush a button "Submit" of a form. Here is my situation:
I don’t have access to HTML as it is a Drupal application.
I made a script that checks the browser’s localStorage and if the page has already been visited it disappears with the button. The problem is that the button would disappear forever.
var visita = localStorage.getItem('visited');
if(visita == 'true'){
$("#edit-submit-teste").hide();
}
$("#views-exposed-form-teste-page").submit(function(e){
localStorage.setItem('visited', 'true');
$('option:selected', this).attr('name', "bananinha");
});
To try to get around this, I wrote in the same script that every time the year or month changed, the button would come back from the ashes. The problem is that when the user returned for a year that had already been submitted the boot appeared even so.
So, there in the code above, when the form was submitted I added a name to the option that was selected in the act. But I failed because every time I refresh the page the name goes.
$("#edit-field-de-value-value-year").change(function(){
var attr = $('option:selected').attr('name');
if (typeof attr !== typeof undefined && attr !== false) {
$("#edit-submit-teste").hide();
}else{
$("#edit-submit-teste").show();
}
});