I have a bunch of inputs like this:
<input />
<input />
<select>
<option>First Option</option>
<option>Second Option</option>
</select>
<input />
What I need to do is create a string with all the values of the inputs and the text of the selected option.
I actually don't know how many inputs and selects there will be, I just need to grab all their values/text, however many forms there are, and put them into a string. To be extra tricky, I also need to parse the option value. Where it says First Option, I need it to become option1, and Second option to become option2 (this is just manual replacement via regex, there is no pattern, and only a few values to replace).
So for example:
<input value="sample text"/>
<select>
<option selected="selected">First Option</option>
<option>Second Option</option>
</select>
<input value="just an example value"/>
"sample text1stoptionjust an example value"
or:
<input value="an example"/>
<input value="sample text"/>
<select>
<option selected="selected">First Option</option>
<option>Second Option</option>
</select>
<select>
<option>First Option</option>
<option selected="selected">Second Option</option>
</select>
"an examplesample textoption1option2"
Thanks!