0
I have a problem with a button where I need to change its link with javascript or php.
Come on!
My platform generates an automatic form, but I don’t have access to the source code. The form collects name and email and sends to the platform, for this reason the form is already ready. However when collecting the data, continues on the same page, I need to redirect to another page to the user click the button and the button also continue with the functionality of registering the data on the platform, however I do not have the source code as said above.
I can see the id’s, class, name and everything else by "inspecting" the browser, I wonder if there is any way to redirect the page with js or php knowing that I know the attributes above.
<div class="pages">
<cxc.newsletter/>
</div>
This div is to call the platform form already ready. When it is displayed in the browser, it shows the form with the fields to fill in, and these fields have their id, name, class that I also use to style inputs and button.
Please, edit your question and provide a minimal, complete and verifiable example.
– NoobSaibot
How do you intend to do this without access to the source code?
– Sam
I have access to all html, less what the platform generates, which is what is inside the div that is in the question.
– Guilherme Luis
This <cxc.newsletter> calls on the platform the inputs and the button, already with the defined class, id, and default name... has no way to change, I want to know if with this information I have if I can change the button link.
– Guilherme Luis
Have you tried using the
addEventListener
javascript?– Woss
When you submit the data for registration, the page reloads or is an Ajax?
– Sam
What you can not change is the destination of the form, otherwise you will not register the data sent. However, there is a way to redirect after sending the form. You need to know what changes on the page after this submission and knowing this, with Javascript.
– Sam
I don’t know the addeventlistener no Anderson :/
– Guilherme Luis
Actually it’s not a form, I was trying to make another method and I realized now! It’s just two text inputs and a button just inside that div.
– Guilherme Luis
It doesn’t matter if it’s a form. You have to know how this works, how data is sent, whether the page reloads etc. This information is crucial for a solution.
– Sam
The page does not reload. And the data is sent by a js code via POST.
– Guilherme Luis
Got it. But then a confirmation message appears?
– Sam
Yes, and if one of the fields has not been filled in it shows the error message.
– Guilherme Luis
All right. What we need to know is when the POST ended. With the "inspect element" of the browser, see if the confirmation message has an ID.
– Sam
Yes, id, class tbm
– Guilherme Luis
Swap the answer ids with the corresponding ids and see if it works.
– Sam
I still don’t understand how you will use the data if you don’t have access, you have html but you don’t have the login form?
– WMomesso
It’s not a @Wmomesso login, it’s two fields to "capture" data and the send button. I own the html code, but I don’t have the code that is generated by the platform, which is the div I demonstrated in the question.
– Guilherme Luis