リロード不要!Server Actionsで即フォーム送信
VISTA DE CÓDIGO
エディタを読み込み中…
P
Prompt
Create a single HTML file with embedded CSS and JS that demonstrates a Next.js-like Server Actions form submission using a simple mock server. The form should have fields for name and email, and submit without page reload, showing a loading state and success/error messages. Use only vanilla JavaScript (no framework) but style it with Tailwind CSS via CDN. The mock server should simulate a 1.5 second delay and return a success response.
この例は、ページリロードなしでServer Actions風のフォーム送信を実演します。バニラJSでフォーム送信をインターセプトし、入力検証、ローディングスピナー表示、1.5秒の遅延シミュレーション、成功/エラーメッセージ表示を行います。Tailwind CSSでクリーンでモダンな見た目にスタイリングしています。
¿Te resultó útil este prompt?
Comentarios
Los comentarios aparecen después de la moderación
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選