Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update form from query preload?

Status
Not open for further replies.

mptwoadmin

Programmer
May 15, 2006
46
0
0
US

Hi Im trying to popluate all the input fields in my form in one shot.
Is it possible to do what I am attemping to do below? I am lost on what I am doing incorrectly now? I get no errors but my form fields are not populated either..

Thank You

<cfquery name="_data" datasource="db">
SELECT *
from PerformanceBoard
</cfquery>

<cfset xx = QuotedValueList(_data.tagname)>

<script type="text/javascript">
function loadIt(){
var myStringArray = [<cfoutput>#xx#</cfoutput>];
for (i=0,tot=myStringArray.length; i < tot; i++) {
(document.getElementsByName("myStringArray").value = "123456");
}}
</script>

<body onload=loadIt();>
<form name=perf method="post" >
<input type="text" class="form-textbox" id="input_1a" name="so_currentmonth_safetyrate" size="20" />
<input type="text" class="form-textbox" id="input_1a" name="so_currentmonth_goal" size="20" />
</form>
</body>
 
Is there a reason you don't want to use the <input> element value attribute?

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top