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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:24:04+00:00 2026-06-07T04:24:04+00:00

I am coding a multi step form. At the end of this form i

  • 0

I am coding a multi step form. At the end of this form i want to have a div that displays the values of each entry. Some of the entrys need to be formatted. For instance i have length and width as two separate inputs and want to display the result as length X Width. While others would be all on one line. I would like an edit button to be next to each entry.

My Html

<form>
<article id="part1">
<input type"text" name="input1" id="input1">
<input type"text" name="input1" id="input2">
<input type"text" name="input1" id="input3">
<input class="next button" type="button"  value="Next">
</article>

<article id="part2">
<input type"radio" name="radio" id="input4">
<input type"radio" name="radio" id="input5">
<input class="next button" type="button"  value="Next">
</article>

<article id="part3">
<div id="results"></div>
<input name="Submit" type="submit" class="next button submitLast"  value="Order">
</article>
</form>

Each time someone clicks “input.next” the next article shows up.

When they click “input.next” in “article#part2” the last article shows up. The text inside “div#results” should be what was inputed in all other steps including which radio was picked. Each entry should have a button that would allow the person to jump back. Also #input2 and #input3 should be shown on one line like so “#input2″+” x “+”#input3” the rest should be on one line.

I understand that i could use .serializeArray() to display the results but that leave me with two problems.

  1. how to make the two unique inputs show on a single line.
  2. How do i deal with the edit button

Right now i have this function called when the last article is shown.

function showValues () {
var line1 = $("#input1").val()
var line2 = $("#input2").val()+" x "+$("input3").val()
var option1 = $("#input4").is(":checked")
var option2 = $("#input5").is(":checked")
if (option1==true) {
var type = "option1"
}
if (option2==true) {
var type = "option2"
}
$("results").append(line1+"<br>"+line2+"<br>"+type);

}

But how do i add the edit button and tell it to go to the right article when clicked?

  • 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-06-07T04:24:07+00:00Added an answer on June 7, 2026 at 4:24 am

    Try the following code

    function showValues() {
            var line1 = $("#input1").val()
            var line2 = $("#input2").val() + " x " + $("#input3").val()
            var option1 = $("#input4").is(":checked")
            var option2 = $("#input5").is(":checked")
            if (option1 == true) {
                var type = "option1"
            }
            if (option2 == true) {
                var type = "option2"
            }
    
            var data = new Array();
            data[0] = { text: line1, edit: 0 };
            data[1] = { text: line2, edit: 0 };
            data[2] = { text: type, edit: 1 };
    
            for (var i = 0; i < data.length; i++) {
                $("#results").append(data[i].text);
                $("#results").append("<input type='button' value='edit' onclick='changePage(" + data[i].edit + ")' /><br />");
            }
        }
    
        function changePage(pageIndex) {
            // Replace this with whatever code is needed to change the page
            alert(pageIndex);
        }
    

    This is basically the same as your code, except that the data is put into an array first (each item represents a line), and then inserted one line at a time. It also adds the edit button on each line.

    Notice how the edit button inserted has a click handler, which calls a changePage method and passes the appropriate page index value.

    It may have just been a typo, but you were missing the “#” in two of your jQuery selectors.

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

Sidebar

Related Questions

I have a multi-dimensional array similar to the example below that I want to
During this year there will be coming couple sub-600€ multi-touch portable computers that contain
I am coding a survey that outputs a .csv file. Within this csv I
Latelly I've been working with multi-thread coding, after a while writing I realized that
It's been quite some time now that I've been coding in C++ and I
I want to work on multi-threading, but my current project do not have such
I am coding a portal which has multi categories. Example: http://localhost/portal/cats http://localhost/portal/dogs Ofcourse this
I have a returned multi dimensional array from my DB, looking something like this
I have made an app and i want to make it multi touch compatible.
When coding with Eclipse, how do you turn off the * comments that come

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.