I have a form that contains multiple inputs, and each input has its own respective button. I'm looking to have each button insert the adjacent input's typed value into a new browser tab and opens that address on click of the button.
Let’s say I type 121680573 into the text field, and when I click the button next to the field, this address should be opened in a new tab:
a810-bisweb.nyc.gov/bisweb/JobsQueryByNumberServlet?passjobnumber=121680573&passdocnumber=&go10=+GO+&requestid=0
The typed value would have to be inserted into that specific position after the = sign.
Thus far this is the only code I've come up with to accomplish this task (I created an alert for the sake of this example being I don't know how to accomplish the insertion of text). #bis represents the button:
$(document).ready() {
var bis_button = $('.bis_button');
bis_button.click(function() {
alert(bis_button.val());
});
});
The inputs and buttons are arranged like this in a WordPress page. Each input is assigned an ID by the WordPress plugin that's creating the page:
<div id="frm_field_[id]_container" class="frm_form_field form-field [required_class][error_class]">
<label class="frm_primary_label">[field_name]
<span class="frm_required">[required_label]</span>
</label>
[input]
[if description]<div class="frm_description">[description]</div>[/if description]
[if error]<div class="frm_error">[error]</div>[/if error]
<div class="bis_button">View in BIS</div>
</div>
I've attached an image that shows the fields and their respective buttons.: