javascript - How do I exchange multiple fields in a link? -


i can replace 1 input field word in link, how do if need exchange multiple fields?

i tried out know, couldn't find solution. code 1 word exchange use:

<script type="text/javascript">   function sdc_go(l){location.href=l.replace(/test/ , escape(document.forms[0].elements[0].value));} </script>  <div>   <p align="center">     <input type="text" test="l" value="" style="width:100px;font-size:16px">   <p align="center">     <input name="button23" type="button" class="inp1" onclick="sdc_go('https://www.google.com/#output=search&sclient=psy-ab&q=test&oq=test&gs_l=hp.3..35i39j0i20j0l2.3900.4643.0.6333.4.4.0.0.0.0.401.1543.3-2j2.4.0.cappswebkhl..0.0...1.1.12.psy-ab.mjyg6dhkqu0&pbx=1&bav=on.2,or.r_cp.r_qf.&bvm=bv.46340616,d.ewu&fp=5d2a0caa618f44e0&biw=1464&bih=815')" value="google"> </div> 

can me understand how can adapt multiple entry fields , words exchanged?

try /test/g

it's global replace of occurances of pattern


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -