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 407961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:38:46+00:00 2026-05-12T17:38:46+00:00

Outline I’m building a form for a specific page, where users can make suggestions

  • 0

Outline

I’m building a form for a specific page, where users can make suggestions about the contents of any page.

The form is displayed inside modal dialogue box, and allows the user to make their suggestions without being taken away from the page they were on.

Of course, I’m designing the code for reuse – write once, utilise many – to provide a similar method of form display and submission anywhere on the site without having to re-write code.

Environment

The site is hosted on an IIS6 server, pages are in ASP, and sending the form data via email using the trusty, classic ASP FormMail script from BrainJar.

Problem

The modal dialogue box works a treat, and using this example from Nettuts+ to perform the submit from within the modal.

The Nettuts+ script is built it such a way that you need to define all the individual field that make up your form to be passed to your formmail script.

Thus each time you need to use it, you’ll need to update how var dataString is combined, which depending on how much caffine you’ve had or the number of painful users knocking down your door leaves you open to simple mistakes that can take hours to diagnose and correct.

Each field is then compiled into a variable known as dataString:

var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone;

Ajax then kicks in, and submits the data to the script, and depending on the result a success message will appeared within the defined div:

$.ajax({
  type: "POST",
  url: "/_global/assets/scripts/formmail/formmail.asp",
  data: dataString,
  success: function() {
    $('#contact_form').html("<div id='message'></div>");
    $('#message').html("<h2>Suggestion received</h2>")
    .append("<p>Thanks, your suggestion has been received and
    will be actioned as soon as possible.</p>")
    .hide()
    .fadeIn(1500, function() {
      $('#message').append("<img id='checkmark' src='images/check.png' />");
    });
  }
....

Desired result

Make this piece of code globally reusable, and have var dataString populated with all field names and values from the form using a loop.

  • 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-05-12T17:38:46+00:00Added an answer on May 12, 2026 at 5:38 pm

    Er – are you looking to use $('#contact_form').serialize() which you can append after data: so the result is data: $('#contact_form').serialize() or am I mistaken by your question wording?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an outline view with 2 entities being displayed inside it so It
Hopefully, I can get answers for each database server. For an outline of how
I can make Firefox not display the ugly dotted focus outlines on links with
I have an outline view delegate and am overriding outlineView:dataCellForTableColumn:item: to make the cells
Here is an outline of a page I'm developing. <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE html
Outline OK, I have Google'd this and already expecting a big fat NO!! But
To outline: I have a parser that grabs Cell references using the following regex
Typing Ctrl+O twice in editor when a java type is selected pops-up an outline
I have a few classes, such as those that outline database table structure or
Outline My simple application takes text from a text box and calls an asp.net

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.