/    Sign up×
Community /Pin to ProfileBookmark

How to create loop and store in hidden field?

This is the form:
[IMG]http://farm6.static.flickr.com/5012/5499392415_b0abdbf1a6_z.jpg[/IMG]

This is mysql:
[IMG]http://farm6.static.flickr.com/5095/5499988172_d7373a7a49_z.jpg[/IMG]

Here are my code so far:

[code=php]
<script>
function changeDisplaycola(flag)
{
if (flag) { document.getElementById(‘cola’).disabled = false; }
else { document.getElementById(‘cola’).disabled = true; }
}
function myPopupcola() {
window.open( “http://farm6.static.flickr.com/5219/5447354652_660c609ae1_m.jpg”, “myWindow”,
“status = 1, height = 200, width = 250, resizable = 0″ )
return false;
}

</script>
<td>
<input name=”Menu[]” type=”checkbox” value =”Dolly Cola” onclick=”changeDisplaycola(this.checked)”/></td>
<td class=”style11″ style=”width: 247px; “>&nbsp;&nbsp; Dolly Cola&nbsp;&nbsp;
<input name=”btncola” src=”http://ocw.ksu.edu.tw/file.php/249/openclipart/album/TzeenieWheenie/TzeenieWheenie_Small_blue_i_info_button.png” type=”image” onclick=”return myPopupcola()” height=”20″ width=”20″/></td>
<td style=”width: 92px” class=”style10″ >&nbsp;&nbsp;&nbsp; RM 2.50&nbsp;&nbsp;&nbsp; </td>

<td style=”width: 98px” class=”style10″>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select name=”Quantity” class=”ff” id=”cola” disabled=”disabled” style=”width: 37px”>
<option value=”0″>0</option>
<option value=”1″>1</option>
<option value=”2″>2</option>
<option value=”3″>3</option>
<option value=”4″>4</option>
<option value=”5″>5</option>
<option value=”6″>6</option>
<option value=”7″>7</option>
<option value=”8″>8</option>
</select></td>

<td style=”width: 101px” class=”style12″>
<input type=”text” name=”Subtotal” id=”totalcola” value=”0.00″ style=”width: 70px”/></td>
[/code]

For your information, Total at the form are the Subtotal in the db. I want to create loop for the quantity and subtotal as the value insert are not correct. Tq. Really appreciate your help and guide. ?

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @stepbystep spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...