PHP, jAVASCRIPT setting input values, why isn't it working?
Posted on
16th Feb 2014 07:03 pm by
admin
Hi:
I am calling this javascript:
<script language="javascript">
Did you know?Explore Trending and Topic pages for more stories like this.
function set_item_values(x)
{
document.forms.form1.GetElementById(x).value = "itemcode";
}
</script>
from here, to set other values in the form:
<select name="Product_Pick" size="1" id="Product_Pick" onchange="set_item_values(document.forms.form1.Item_Code)">
<?php
do {
?>
<option value="<?php echo $row_Product_Select['Product_Code']?>"><?php echo $row_Product_Select['Product_Code']?> - <?php echo $row_Product_Select['Name']?></option><?php
} while ($row_Product_Select = mysql_fetch_assoc($Product_Select));
$rows = mysql_num_rows($Product_Select);
if($rows > 0) {
mysql_data_seek($Product_Select, 0);
$row_Product_Select = mysql_fetch_assoc($Product_Select);
}
?>
The value I have in there so far is just a proving string...
It ain't working, but I don't know why, and I am having problems finding a good reference for using php and javascript for working with documents and events in html, so that i can set off a value change to set values for several fields, or perform actions.
Can I have my hand held please and someone get me up and running? I have been programming for 15 years or so and in different languages (from pl1, jcl, pascal, to basic, java) so what I guess a good insight into using variables and syntax would get me going...
No comments posted yet
Your Answer:
Login to answer
348
48
Other forums
problems with contact forms that are only protected against SQL injections
What could be a potential problem with contact forms that are only protected against SQL injections
question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.
I hav
Displaying image from database
Hi,
I've got a site where that's got a database behind it. Currently it has loads of items in
Preg_match unknown modifyer
Hello,
Im trying to write a little script for my forums i need to get the reply from my forum
imap: how to save a copy of sent emails to sent elements
Hello my friends,
I am writing an online emailing application with inbox outbox/sent elements
Ajax not working on IE 6 for Windows CE
I've created a webpage which uses the classis Ajax in following format:view plaincopy to clipboardpr
Array becomes unset by itself?
Hi,
I have a bit of experience with PHP but not extensive. It seems I cannot store any items
getting a website's source code as a variable? How?
Hey guys, is there any way for me to get the source code of a website as a variable for me to work w
How to copy a part of a vector in a raw memory
Hi,
How can I copy a part of a vector into a memory:
1
2
3
4
5
PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot rede