<@498057949541826571> good morning, regarding my q...
# support-questions
f
@rp good morning, regarding my question from earlier about , in my EmailPasswordSignUp_Override I'm trying to implement an
Copy code
onChange
event. However, it's firing on a "blur" event.
r
Hey @funk101
Yea. Can you please post the code with more context?
f
I've copied what you showed me from the onBlur() is the syntax correct?
I've added an "state" field and as the user types it's pulling the state from the db
I would like it to update in an onChange, however, it only populates in the "blur" event
"state" meaning "Texas, Florida, California, etc"
r
Hmm. I’ll get back in a few hours. Not sure how to do this right off the top of my head. But should be possible. It’s all just JS at the end of the day
f
ok
r
hey @funk101 i don;t think i quite undertsand the issue you are facing. Can you explain?
f
onChange isn't firing however onBlur changes the value as I was expecting onChange to do
make sense?
r
Hmmmm. I’m not too sure about this. It’s more a plain JS problem
But if you can’t figure it out, I’ll setup a small test tomorrow
f
you see my code? can you see anything that looks out of whack?
r
Nothing that’s obviously wrong
So will have to try and see properly
f
ok, then I'll keep digging in
thanks
can I leave this thread open?
r
Yes sure
f
ok, later
is this part ok?
Copy code
phoneInput.addEventListener("blur", onBlur);
                stateInput.addEventListener("change", onChange);
                return () => {
                  phoneInput.removeEventListener("blur", onBlur);
                  stateInput.removeEventListener("change", onChange);
                };
r
Yeaaa. This seems fine
f
ok
you there?
r
Right. Yea. I’m not sure how I can help here. This is a JS related query.
f
actually, I need to try to write a custom signup form to add an "address field" which has a geo lookup to grab the street, city, state. Which part of the docs should I be looking at?
r
Right yea. So you can’t customise that much of the sign up form yet. So the best best choice is to ask them that as a second step in the sign up process.
Or then you can make your own sign up form using the override. That works too
f
so I can make my own sign up form?
wehre in the docs is that?
r
Yea. If you override the right component, you can make your own form in that
We don’t have docs for that exactly
f
oh, it's not "Embed Sign In/ Sign up form in page"?
r
I mean we don’t have docs for how to make your own sign up form, but we have docs for how to override react components. But I think you already know how that’s done
No. The embed one is about putting out sign in form in an existing page as opposed to a new page.
f
so "REact component override"
r
If I were you, I would make it a second sign up step.
f
ok
so after they do the default signup, where do I redirect them to the "add address" page?
r
Anywhere you’d like. It’s a page that you make and control
f
no I mean in backendConfig, or frontendConfig, there must be a place to redirect to address, right now I have "redirectToPath"
r
Huh?
f
so, here ->
Copy code
EmailPasswordReact.init({
        getRedirectionURL: async (context) => {
          if (context.action === "SUCCESS") {
            if (context.redirectToPath !== undefined) {
              // navigate back to where the user was before authenticated
              return context.redirectToPath;
            }
            return "/dashboard";
          }
          return undefined;
        },
r
What is redirect to address?
f
after they signup it redirects back to page they were on
r
I mean, you need to check it a new user was created, and if yes, redirect them to the page where you ask them their address
Instead of using redirectTo Path
f
right got it now, I believe
r
Cool!