I have a script where I can PregReplace something in a string with a defined value from my input field and it works like a charm.
echo '<input id="pfrom" type="text" value="" name="pfrom">';
function demoRegex(){
var txt = document.newform.thestring.value;
var re = new RegExp(document.newform.pfrom.value, "g");
newtxt = txt.replace(re,'');
alert(newtxt);
}
But what if I have multiple input field like this:
foreach($arr as $arr1=>$value){
echo '<input id="pfrom" type="text" value="" name="pfrom[]">';
}
How do I get the javascript to run through all the fields?
Hoping for help… Thanks in advance