Hi,
I'm new to php, but however, I can manage small changes.
I've a small html/java script. I want to achieve the same through php.
Please help, how can I do this.
create a new html file, copy the below script, save the file and run it in a browser. I want to get the same results using a php file. Please help me how to do this. Thanks in advance.
<script type="text/javascript">
function addItem(itemValue,outputDestination){
formElement = document.forms['myForm'].elements[outputDestination]
tempVar = formElement.value
if (tempVar.lastIndexOf("\n") != tempVar.length-1){
}
formElement.value = itemValue;
}
</script>
<form name="myForm" id="myForm">
<select onchange="addItem(this.value,'textOutput2')">
<option value="A1">A1</option>
<option value="A2">A2</option>
<option value="A3">A3</option>
<option value="B1">B1</option>
<option value="B2">B2</option>
<option value="B3">B3</option>
<option value="C1">C1</option>
<option value="C2">C2</option>
<option value="C3">C3</option>
</select>
<textarea style="displaynone;" name="textOutput2" cols="10" rows="1"></textarea>
<br />
</form>
Regards,
Vinay
I'm new to php, but however, I can manage small changes.
I've a small html/java script. I want to achieve the same through php.
Please help, how can I do this.
create a new html file, copy the below script, save the file and run it in a browser. I want to get the same results using a php file. Please help me how to do this. Thanks in advance.
<script type="text/javascript">
function addItem(itemValue,outputDestination){
formElement = document.forms['myForm'].elements[outputDestination]
tempVar = formElement.value
if (tempVar.lastIndexOf("\n") != tempVar.length-1){
}
formElement.value = itemValue;
}
</script>
<form name="myForm" id="myForm">
<select onchange="addItem(this.value,'textOutput2')">
<option value="A1">A1</option>
<option value="A2">A2</option>
<option value="A3">A3</option>
<option value="B1">B1</option>
<option value="B2">B2</option>
<option value="B3">B3</option>
<option value="C1">C1</option>
<option value="C2">C2</option>
<option value="C3">C3</option>
</select>
<textarea style="displaynone;" name="textOutput2" cols="10" rows="1"></textarea>
<br />
</form>
Regards,
Vinay
Comment