The Possibilities Newsletter - [P#1198] Submit Any Form Via Ajax

top of page
Possibilities
Coding Tips, Tricks, and Treasures
(For website owners and developers.)
July 12, 2022
- Issue 1198 -

Will and Mari Bontrager, Publishers
Copyright 2022 Will Bontrager Software LLC


Possibilities

You are subscribed as you
Find unsubscribe information at bottom of newsletter.

Article:

Submit Any Form Via Ajax

(Click to read the newsletter online.)


Prelude:

Hello ,

Half price for the first of my candy recipe books —

$2.99 instead of $5.99

The Amish Recipes: Chocolate-Covered Candy ebook is half price during July when purchased at Smashwords (not at other retailers).

Go buy it at half price at Smashwords

Other purchase options (Kindle, iBooks, …)

This is the first of my Amish-recipe candy books. It contains stories about my relationship with candy while growing up.

Once you have made chocolate-covered candy a time or several, it can become surprisingly easy for you. This special candy is so good it is bound to be highly praised by anyone you share it with.

Smashwords  •  Other retailers

~ — O — ~

Last week's article —

It is possible to build expanding/collapsing navigation menu items with pure HTML. No JavaScript. And, optionally, no CSS.

willmaster.com/…/without-javascript.php

~ — O — ~

This week's article —

(Quick link) Ajax form submission with any form — without knowing in advance what the field names are, or how many fields the form has.

Enjoy the issue, .

Will Bontrager


Possibility:

Submit Any Form Via Ajax

Recently, I needed to use Ajax to send form information to a script on a server.

The form fields were unpredictable. Sometimes there may have been an email field and sometimes not, for example. Sometimes the form had dozens of fields to submit, sometimes only a few.

Further, there were some form fields that should not be sent to the script (fields used for determining the content of other fields, like math formulas).

The requirement led me to create a simple JavaScript function for submitting a form via Ajax — without knowing in advance what the form fields would be.

What is Ajax?

Ajax is a tool programmed with JavaScript. The tool is used to send information to and get information from URLs. The way it connects to the URLs is with HTTP or HTTPS, the same methods that browsers use.

What makes Ajax special is that it can use HTTP/S to connect to other web pages or software on the internet from within the web page already loaded in the browser.

Thus, Ajax can be used to send form information to a PHP script on the server — without reloading the web page that has the form.

When Ajax is used to send form information to a server script, the form field names generally are specified within the Ajax source code. Yet when, as in the situation described above, the form fields are not known ahead of time and might change from page load to page load, form field names can not be specified with acceptable accuracy.

Another way had to be found. That method is what this article is about.

The online article goes into more detail. It also provides a simple little PHP script you can use for testing your Ajax.

Thank you for reading Possibilities.

~ — O — ~

Recent additions to the Willmaster Blog and Library

Forward Possibilities to
someone who will appreciate it.
Thank you!
sun
@

We suggest and recommend only what we believe is of value. As remuneration for the time and research involved to provide quality material, we sometimes use affiliate links. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.


Addresses, URLs, and Subscription Maintenance:

Click to unsubscribe:
https://www.willmaster.com/possibilities/cmfposs/possmailer_unsubscribe.php?0f452844c528f36b84dcfc5074560ba0

To subscribe: https://www.willmaster.com/possibilities/

Changing email address: First unsubscribe your old address, then subscribe with your new email address.

Will Bontrager Software LLC, Publishers
P.O. Box 153
Lowell, IN 46356
USA

Copyright 2022 Will Bontrager Software LLC


Subscription Record:

Please Note: We do not make our mailing lists publicly accessible. Privacy is precious. We respect yours.

Subscription information:

Email: you

To remove your subscription (to unsubscribe), use this link:
https://www.willmaster.com/possibilities/cmfposs/possmailer_unsubscribe.php?0f452844c528f36b84dcfc5074560ba0

Key phrases

Older messages

[P#1199] Daily Content for Many Websites

Wednesday, July 27, 2022

top of page Possibilities Coding Tips, Tricks, and Treasures (For website owners and developers.) July 19, 2022 - Issue 1199 - Will and Mari Bontrager, Publishers Copyright 2022 Will Bontrager Software

[P#1200] Image Resizing

Wednesday, July 27, 2022

top of page Possibilities Coding Tips, Tricks, and Treasures (For website owners and developers.) July 26, 2022 - Issue 1200 - Will and Mari Bontrager, Publishers Copyright 2022 Will Bontrager Software

You Might Also Like

The clock’s ticking for TikTok

Wednesday, April 24, 2024

The US Senate has passed a bill that would ban TikTok if its US business is not divested by Bytedance View this email online in your browser By Alex Wilhelm Wednesday, April 24, 2024 Good morning, and

How to block Windows 11 Start menu ads

Wednesday, April 24, 2024

Oura Ring hits Target; 7 iPad Pro features we need; AI hallucinations aren't all bad -- ZDNET ZDNET Tech Today - US April 24, 2024 placeholder Microsoft is now showing ads in Windows 11's Start

The Chilling of TikTok

Wednesday, April 24, 2024

Ban or not, this is the end of TikTok as we know it The Chilling of TikTok By MG Siegler • 24 Apr 2024 View in browser View in browser The tok is tiking... Later today, President Biden will sign a bill

GenAI is transforming materials design

Wednesday, April 24, 2024

‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

⚙️ Meta Smart Glasses

Wednesday, April 24, 2024

Plus: $3B valuation for AI startup ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Endpoint Security Tips Curated by Experts - Get This Guide Now

Wednesday, April 24, 2024

Endpoint Security Tips Curated by Experts Hey there, It's no secret that endpoints are prime targets for hackers—so how can you defend them better? Well, we have some suggestions for where you can

Senate passes the bill that could ban TikTok

Wednesday, April 24, 2024

The Morning After It's Wednesday, April 24, 2024. The Senate approved a measure that will require ByteDance to sell TikTok or face a ban, in a vote of 79 to 18. The Protecting Americans from

[Incubator] Dates for our next Student Orientation and Demo Day

Wednesday, April 24, 2024

Also, here's the link to our last student demo day. ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Warning: Security Flaws Exposed Keystrokes of Over 1 Billion Chinese Keyboard App Users

Wednesday, April 24, 2024

THN Daily Updates Newsletter cover Webinar -- Uncovering Contemporary DDoS Attack Tactics -- and How to Fight Back Stop DDoS Attacks Before They Stop Your Business... and Make You Headline News.

Post from Syncfusion Blogs on 04/24/2024

Wednesday, April 24, 2024

New blogs from Syncfusion What's New in React Query Builder: 2024 Volume 1 By Satheeskumar S This blog explores the new features added to the Syncfusion React Query Builder in the 2024 Volume 1