0
I have two separate pages:
- The first contains a form with two fields
input
of the kinddate
, among other information. - The second page receives a data from the form information that I mentioned before, but not the dates.
The first sends this data to the Mongo DB Atlas. The second shows one of these data, which is a button title. On these two pages I’m using the Node.js also.
I have a function that checks whether the current date is longer than the final date passed by the user. If yes, when this condition is met I would like that button, which in turn is on the second page, ie in a file html
different, would be automatically disabled.
It seems advanced to me and I do not know if it is possible to do such a thing, because it involves two files html
different, where one possesses the input
of the kind date
- and consequently it is in this file that I must include the script
which does this check - and another, where is the button I need to have disabled when this condition - if the current date is longer than the final date - is true.
In short, I need to make this function written in a separate file perform an automatic action in another file html
different.
I asked a question here and a friend of Sopt helped me to arrange this function, but it is only a function and still does not solve this new challenge I described above. My biggest challenge now is to exchange this function between two files.
Hello, is the information saved in the database? if yes, in the second html file it is not possible to query the database and check if the condition to display/disable the button is true?
– Jhonata De souza
@Jhonatadesouza Yes, the information is in a database. I haven’t implemented the function yet because I don’t know how to run it in the second file. In case I suppose it should come in the first file, where are the date fields. I did a search and I think the import and export of javascript can help me, I still do not know how but I will test.
– M. Bran