Yeah, there are definitely other ways - JavaScript is flexible, and so is DTM.
Probably the easiest way would be to add a Rule Condition that tests for something else that should also be true.
Before I give any examples - what information are you trying to capture with this event/rule?
I ask because all it is doing/will do is capture when a user has entered a valid birthdate in the top form, and is now viewing the top of the registration form on the bottom of the page.
Is that what you're after?
Or are you looking to capture other information?
e.g. capturing when someone tries to submit the form at the bottom of the page, but gets an error
If the intended purpose of this event is just to capture when someone is viewing the form on the bottom of the page, then you could add a Rule Condition similar to the following:
Criteria = Custom
Custom JavaScript =
(document.getElementById("page").style.display == "block")This is effectively asking "Is the <div> containing all the registration form goodness on the bottom currently visible?"
[img]dtm-custom-script.png[/img]
Adding the above condition should resolve the issue of the event firing prematurely, but as I said, it may not serve the intended purpose. Let us know what you're trying to do, and we could provide some other suggestions.