Hello,
I would like to know if you have a "submit" button on a form. Here is my situation:
I do not have access to HTML because it's a Drupal application.
ImadeascriptthatchecksthelocalStorageofthebrowserandifthepagehasalreadybeenvisiteditaddswiththebutton.Theproblemisthatthebuttondisappearsforever.
varvisita=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 probe is that when the user returned for a year that had already been submitted the button appeared anyway.
Then, 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 or name some.
$("#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();
}
});