0

I developed a website that contains submit buttons that are linked to other pages on my website. I used the action attribute for the links, but it happens that GitHub doesn't support action attributes (HTTP). Is there another way that I can link my submit buttons to other pages but without using the action attribute? Note: the submit button should be inside a form.

<form method="POST" action="../pages/home2.html" target="_self">
    <input type="text" name="username" value="" placeholder="username here" required/>
    <input type="submit" value="Submit" name="submit"/>
</form>

Whenever I click to submit, a 405 problem occurs (not allowed). Help appreciated

3
  • Have you looked at using AJAX to submit the form? Commented Aug 21, 2021 at 11:12
  • Why do you want to send POST request to a simple HTML page? Who/what is reading the post data? Does it work when you use GET instead? Commented Aug 21, 2021 at 11:12
  • 1
    Harrison, Progman, thank you for your response. I'm still a beginner and this is just an example of my form. Anyway, I have just known that GitHub doesn't support method POST or GET, so what I did is that I deleted the method attribute and everything works fine now. Commented Aug 21, 2021 at 15:00

1 Answer 1

2

I finally knew what was the problem. Github happens not to support method="POST" (HTTP), so what I did is that I deleted the method attribute and everything works fine now. Although my form works as if the method attribute is set to GET, because data inserted appears in the url above my website. And the code above is just a simple example of my real form. This is my simple website https://aghbary.github.io/YemeniHtml/

Thanks..

Sign up to request clarification or add additional context in comments.

1 Comment

Please have a look at Can I answer my own question? and come back two days later and check as answered if you have more than 15 reputation (See also: Accept Your Own Answers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.