Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:40:31+00:00 2026-06-04T05:40:31+00:00

Currently I have an HTML page that has many textboxes that need to be

  • 0

Currently I have an HTML page that has many textboxes that need to be validated via Javascript. Once they are all validated, I am wanting to create a user account via a controller.php

My question is this: How can I POST to a PHP file from within a Javascript function. I gather that I can use AJax, however I would like to use it without this if possible.

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:40:33+00:00Added an answer on June 4, 2026 at 5:40 am

    Create a form with the post method and have it point to the php script. If you set it up like this below you do not need to post from the javascript function because the default behavior of the html form will do the posting for you. It also degrades gracefully for people that do not have javascript enabled.

    <form action="/path.to.your.php.file.php" method="POST" onSubmit="return validate();">
     ... your fields...
     <input type="submit" value="validate and submit"/>
    </form>
    
    <script>
      function validate(){
        // do your validation here
        return true; // return true if validation was ok, false otherwise
      }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have an HTML page that has a grey BODY background. Now I
I currently have a product view page that contains an MVCContrib HTML Grid with
The JavaScript code window.print() can print the current HTML page. If I have a
I have an html table with many rows. I'm currently grouping several rows inside
I have an HTML page with a text box. This text box has an
I have a table that has worked correctly for many years, but recently the
Here's what I have: A web application that runs in a single HTML page
I have a large HTML file (In ASP.NET) that has several smaller ... tags
I currently have two html pages, a server hosted page, and a client hosted
I currently have a huge HTML file which doesn't have line breaks and just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.