Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've been tasked with creating a small web application, where users have a series of forms (I can't currently think of a better way of doing this) which will contain, either a)text input fields or b)drop down lists. The form will look as follows:

form1 input box input box drop down box

form2 input box input box drop down box input box

form3 input box dropdown box input box drop down box

Now for each form, I would need to concatenate the resulting string stored within each box (drop down or input). Seems fairly simple and I already have a working prototype. Problem is for each form there can be multiple rows.

What would be the easiest way to approach this? My skills are limited to HTML, CSS, JavaScript and some (light) JQuery. The working prototype I currently have the user fills out all the fields and then presses a "generate" button which generates all the conctenated strings. Is this approach that you would take?

share|improve this question

1 Answer

Use a jQuery selector to select all relevant elements and then use a for loop to iterate over each element and concatenate the strings.

http://api.jquery.com/category/selectors/

More specifically, you could try something like this

http://api.jquery.com/class-selector/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.