以下のjavascriptはこの http://www.google.co.uk/webhp?hl=ja
の値を http://link-ads.blogspot.com/?url=httpに置き換えます%3A%2F%2Fwww.google.co.uk%2Fwebhp%3Fhl%3Den
を入力してください。
<script type="text/javascript">
function showMe(e) {
paramencode = encodeURIComponent(e.value)
document.write('http://link-ads.blogspot.com/?url='+paramencode+'');
}
</script>
<input type="text" id="foo" placeholder="URL here" onchange="showMe(this)" />
It works fine but I now need to inclue an &name=
+ value inherited from second input to the end of the document write ie.
document.write('http://link-ads.blogspot.com/?url='+paramencode+'&name='+andnameinput+'');
where '+andnameinput+'
will inherit the values from a second <input>
EDITED
if i insert http://www.google.co.uk/webhp?hl=en
into the first input
<input type="text" id="foo" placeholder="URL here"/>
the output from the document.write should be http://link-ads.blogspot.com/?url=http%3A%2F%2Fwww.google.co.uk%2Fwebhp%3Fhl%3Den
but it is incomplete as it should have &name= infront with a user input value for that i need a second input
<input type="text" id="foo2" placeholder="Name here"/>
and say if the value 123456789 was input the output returned from the document.write should be http://link-ads.blogspot.com/?url=http%3A%2F%2Fwww.google.co.uk%2Fwebhp%3Fhl%3Den&name=123456789