GifproGifpro

リロード不要!Server Actionsで即フォーム送信

代码预览

P

提示词

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でクリーンでモダンな見た目にスタイリングしています。

这个提示对您有帮助吗?

评论

评论将在审核后显示

首页ヘルプ