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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:04:48+00:00 2026-06-11T23:04:48+00:00

I am having trouble selecting the unique text boxes that are made when they

  • 0

I am having trouble selecting the unique text boxes that are made when they have selected how many they need. It creates two text input boxes one for width and one for length. I want to select what data they input to these boxes once they have created how many they need but I am not sure how to do this. I have tried adding the value to the ‘name’ when the text inputs are created but can’t figure it out.. Any help would be appreciated.

Javascript:

function processSplashbacks() {

var splashbacks = document.worktopForm.splashbacks.value;           
var splashbackInfo = '<label> Length: </label><input type="text" id="length' + t + '" value="0"/>(cm)<br /><label> Width: </label><input type="text" name="width' + t + '" value="0"/>(cm)';

for (var t = 1; t <= splashbacks; t++){
    document.getElementById("splashWidLen").innerHTML += 'Splashback ' + t + ' dimensions' + splashbackInfo;
} }

function calculate() {
    var lengthOne = document.worktopForm.splashWidLen.length1.value;
    document.worktopForm.getElementById("quote").innerHTML += lengthOne;
}

HTML:

<form name="worktopForm">

<select name="worktops">
    <option value="1" selected>1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
</select>

<input type="button" value="Add Splashbacks" onClick="processSplashbacks()"/>

<div id="splashWidLen"></div><br/>

<input type="button" value="Calculate quote" onClick="calculate()"/><br/>

<div id="quote"></div>

  • 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-11T23:04:49+00:00Added an answer on June 11, 2026 at 11:04 pm

    What do you think about using CoffeeScript and JQuery ?

    @addInfo = (splashback) ->
        $("#splashWidLen").append("Splashback #{splashback} dimensions <label> Length: </label><input type='text' id='length#{splashback}' value='0'/>(cm)<br /><label> Width: </label><input type='text' name='width#{splashback}' value='0'/>(cm)<br>")
    
    @processSplashbacks = () -> 
        count = $("select[name='worktops']").val()
        addInfo splashback for splashback in [1..count]
    

    Example of working code on JSFiddle.

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

Sidebar

Related Questions

I'm having trouble selecting the text inside a span element that resides in another
I am having trouble efficiently selecting the information I need to display. Hopefully someone
I am having trouble selecting a hidden form field value that is a part
I'm having trouble selecting a subset of data with doctrine. I have 3 tables
I have made a filter function but I am having trouble with the starting
I'm having trouble selecting links in my html. Here's the html I have: <div
I'm having trouble selecting a list that is mixed with javascript. The original code
I am having a bit of trouble selecting an input. Basically, I need the
I am having trouble SELECTing a column of type uniqueidentifier and putting it in
I am having trouble selecting an item from a Javascript dropdown (i.e. the items

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.