I’m trying to make the input box (on the JSFiddle attached) with the serialize string created in it a href so submiters can click on the link they’ve created to see if it exist already. Is this possible? If not would is be better to hide the input cell with the serialize string and show another serialize output outside of a input box (in a href)?
Javascript:
var partFields = $('#form1').find('input[type=text]').not('#url');
$(partFields).change(function(){
var url = 'static/url/to/file.php?';
var urlValue = url+partFields.serialize();
$('#url').val(urlValue); // set the hidden input value
});
HTML:
<form id="form1" name="form1" method="post" action="">
<p>
<label>Variable 1
<input type="text" name="variable1" id="variable1" />
</label>
</p>
<p>
<label>Variable 2
<input type="text" name="variable2" id="variable2" />
</label>
</p>
<p>
<label>URL
<input type="text" name="url" id="url" />
</label>
</p>
<p>
<input type="button" name="button" id="button" value="Submit" />
</p>
</form>
You can make a link to the created url like this:
Is this what you are trying to do?
I have updated the fiddle.
UPDATED. I have edited the fiddle, so it is the submit button that goes to the generated url.