{"id":169,"date":"2024-05-30T02:01:38","date_gmt":"2024-05-30T02:01:38","guid":{"rendered":"https:\/\/codebox.keyframetechsolution.com\/?p=169"},"modified":"2025-02-17T17:50:06","modified_gmt":"2025-02-17T17:50:06","slug":"show-results-on-submit-form","status":"publish","type":"post","link":"https:\/\/codebox.keyframetechsolution.com\/show-results-on-submit-form\/","title":{"rendered":"Create Show Results On Submit Form Using HTML CSS and jQuery"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p><span data-preserver-spaces=\"true\">Creating a dynamic form where the results are displayed upon submission can be a great addition to websites or applications that require user input and feedback.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In this guide, I will show you how to create a show results on submit form using HTML CSS and jQuery.<\/span><\/p>\n<p>\u2705\u00a0<strong>Watch Live Preview<\/strong>\u00a0\ud83d\udc49\ud83d\udc49<\/p>\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/ARaUd2pABco?si=9BUfexM4QiLSKVGS\" width=\"100%\" height=\"450\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><a href=\"#conclusion\">Click Here to Download the Code<\/a><\/p>\n<div class=\"border-blog-highlight\">\n<h2>Table of Contents<\/h2>\n<ul>\n<li><a href=\"#section1\">What We&#8217;ll Build<\/a><\/li>\n<li><a href=\"#section2\">Prerequisites<\/a><\/li>\n<li><a href=\"#section3\">What are the Steps to Begin?<\/a><\/li>\n<li><a href=\"#section4\">HTML Code Structure<\/a><\/li>\n<li><a href=\"#section5\">CSS Code Structure<\/a><\/li>\n<li><a href=\"#section6\">jQuery Code Structure<\/a><\/li>\n<li><a href=\"#section7\">jQuery Code Structure<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n<\/div>\n<h3 id=\"section1\"><span data-preserver-spaces=\"true\">What We&#8217;ll Build<\/span><\/h3>\n<ol>\n<li><span data-preserver-spaces=\"true\">Create a form using HTML.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Style the form with CSS.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Use jQuery to handle the form submission and show the results without refreshing the page.<\/span><\/li>\n<\/ol>\n<h3 id=\"section2\"><span data-preserver-spaces=\"true\">Prerequisites<\/span><\/h3>\n<p><span data-preserver-spaces=\"true\">Before starting, you must have:<\/span><\/p>\n<ul>\n<li><span data-preserver-spaces=\"true\">Basic knowledge of HTML and CSS.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Understanding of jQuery.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">A text editor to type code.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">A web browser for testing projects.<\/span><\/li>\n<\/ul>\n<p><strong>Also read:<\/strong> <a href=\"https:\/\/codebox.keyframetechsolution.com\/credit-card-form-html-css-jquery\/\">Build a Responsive Credit Card Form with HTML CSS and jQuery<\/a><\/p>\n<h3 id=\"section3\"><span data-preserver-spaces=\"true\">What are the Steps to Begin?<\/span><\/h3>\n<p><span data-preserver-spaces=\"true\">First, create a folder on your computer and add the following files inside it:<\/span><\/p>\n<ul>\n<li><strong>index.html<\/strong><\/li>\n<li><strong>style.css<\/strong><\/li>\n<li><strong>script.js<\/strong><\/li>\n<\/ul>\n<h2><span data-preserver-spaces=\"true\">Source Code<\/span><\/h2>\n<h3 id=\"section4\">HTML Code Structure<\/h3>\n<p><span data-preserver-spaces=\"true\">The first step is to create the structure of the form using HTML. This form will collect user input such as their name and email.<\/span><\/p>\n<div class=\"code-container\">\n<div class=\"toolbar\">\n<div class=\"actions\">\n        <span><\/span><br \/>\n        <span class=\"yellow\"><\/span><br \/>\n        <span class=\"green\"><\/span>\n      <\/div>\n<div class=\"title\">index.html<\/div>\n<\/p><\/div>\n<div class=\"code-content\">\n<pre><code class=\"language-markup\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"UTF-8\"&gt;\r\n  &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\r\n  &lt;title&gt;Create Show Results On Submit Form Using HTML CSS and jQuery &lt;\/title&gt;\r\n  &lt;link rel=\"stylesheet\" href=\"style.css\"&gt;\r\n  &lt;link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/font-awesome\/4.7.0\/css\/font-awesome.min.css\"&gt;\r\n  &lt;script src=\"https:\/\/code.jquery.com\/jquery-3.5.1.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/typed.js\/2.0.11\/typed.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/waypoints\/4.0.1\/jquery.waypoints.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.3.0-alpha1\/dist\/css\/bootstrap.min.css\"&gt;&lt;\/script&gt;\r\n  &lt;link rel=\"stylesheet\" href=\"https:\/\/fonts.googleapis.com\/css2?family=Poppins:wght@400;500;600;700&amp;family=Ubuntu:wght@400;500;700&amp;display=swap\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;!-- CODE --&gt;\r\n\r\n&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.3.0-alpha1\/dist\/js\/bootstrap.bundle.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"script.js\"&gt;&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<h3 id=\"section5\">CSS Code Structure<\/h3>\n<p><span data-preserver-spaces=\"true\">Next, let\u2019s add some CSS to enhance the form\u2019s visual appeal and improve its user interface.<\/span><\/p>\n<div class=\"code-container\">\n<div class=\"toolbar\">\n<div class=\"actions\">\n        <span><\/span><br \/>\n        <span class=\"yellow\"><\/span><br \/>\n        <span class=\"green\"><\/span>\n      <\/div>\n<div class=\"title\">style.css<\/div>\n<\/p><\/div>\n<div class=\"code-content\">\n<pre><code class=\"language-markup\">\r\n&lt; \/* Your CSS code here *\/ &gt;\r\n&lt; * { &gt;\r\n\r\n&lt; margin: 0; &gt;\r\n&lt; padding: 0 &gt;\r\n&lt; box-sizing: border-box; &gt;\r\n&lt;     text-decoration: none; &gt;\r\n&lt;     } &gt;\r\n      <\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<h3 id=\"section6\"><span data-preserver-spaces=\"true\">jQuery Code <\/span>Structure<\/h3>\n<p><span data-preserver-spaces=\"true\">Now, let\u2019s add jQuery to handle the form submission. We will use jQuery to:<\/span><\/p>\n<ul>\n<li><span data-preserver-spaces=\"true\">Capture the form data.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Prevent the page from refreshing when the form is submitted.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Show the result below the form after submission.<\/span><\/li>\n<\/ul>\n<p><span data-preserver-spaces=\"true\">Here\u2019s the jQuery script:<\/span><\/p>\n<div class=\"code-container\">\n<div class=\"toolbar\">\n<div class=\"actions\">\n        <span><\/span><br \/>\n        <span class=\"yellow\"><\/span><br \/>\n        <span class=\"green\"><\/span>\n      <\/div>\n<div class=\"title\">script.js<\/div>\n<\/p><\/div>\n<div class=\"code-content\">\n<pre><code class=\"language-markup\">\r\n&lt; \/\/ jQuery Code &gt;\r\n      <\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<h3 id=\"section7\"><span data-preserver-spaces=\"true\">Test Your Code<\/span><\/h3>\n<p><span data-preserver-spaces=\"true\">Now, save all the files and open the HTML file in a web browser to test the form. <\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><span data-preserver-spaces=\"true\">When the user enters their details and submits the form, the page will display the submitted data on the right side without refreshing.<\/span><\/li>\n<li>The form will remain, and the results section will become visible, showing what was entered in the input fields.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Also read: <\/strong><a href=\"https:\/\/codebox.keyframetechsolution.com\/bootstrap-5-login-register-form\/\">How to Create Bootstrap 5 Login and Register Form<\/a><\/p>\n<h2 id=\"conclusion\"><span data-preserver-spaces=\"true\">Conclusion<\/span><\/h2>\n<p><span data-preserver-spaces=\"true\">In this tutorial, we&#8217;ve learned how to create a dynamic form that shows results on submit. <\/span><span style=\"font-size: 16px;\">This is a great way to create interactive forms for your website or application.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">You can also expand on this by adding form validation, additional styling, and more advanced interactions using jQuery.<\/span><\/p>\n<p><strong><i class=\"fa fa-download\" style=\"color: #046bd2;\"><\/i> 33 people bought this<\/strong><\/p>\n<p><strong>Grab it Now for Just <i class=\"fa fa-rupee\" style=\"color: #046bd2;\"><\/i><span style=\"color: #046bd2;\">20<\/span><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Creating a dynamic form where the results are displayed upon submission can be a great addition to websites or [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":171,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[206],"tags":[432,430,431,429],"class_list":["post-169","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-login-and-register-form","tag-dynamic-form-html","tag-form-submit-response-on-same-page","tag-on-form-submit","tag-show-results-on-submit-form"],"acf":[],"_links":{"self":[{"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/posts\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/comments?post=169"}],"version-history":[{"count":10,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/posts\/169\/revisions"}],"predecessor-version":[{"id":1556,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/posts\/169\/revisions\/1556"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/media\/171"}],"wp:attachment":[{"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/media?parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/categories?post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/tags?post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}