|
-
Dec 31st, 2010, 09:29 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] calling java script function with form data
i have an function in a js page that i call with an onclick event in a html form like this. its called showcolorgrid2
<input type="button" onclick="showColorGrid2('menucolor','sample_1');" value="Menu Color"> <input name="menucolor" type="text" id="menucolor" size="9" value="<?php echo $menucolor; ?>"> <input type="text" ID="sample_1" size="1" value="">
when you click the button it loads the sample_1 field with the color of the hex value that is populated in menucolor field. so menucolor has the hex value in text and the sample_1 is colored in as the color. it works fine but since i populate it from a database with php with the current value i would like to be able to when the form loads have the sample_1 show the color. right now its blank until the user clicks the button.
how can i call that function with the value of menucolor when the page loads?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|