CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Editable Grid Autofill Autoincrement

Print topic Send  topic

Author Message
DonP
Posted: 03/19/2008, 4:18 PM

I have an editable grid used for selecting songs to assign them to a
particular recording. One field is the one on which the grid is ordered,
which is the order that the songs are on the recording. It is selected
by a drop down but it is very tedious when there are many tracks (such
as the 47 track 3-disk CD that I entered yesterday!) so maybe there is a
way that when the first one is selected, the others will increment by
one and automatically make the proper selection. Additionally, there is
another drop down where the "side" of the album is selected (these are
often vinyl recordings) and I would like the order field to start over
at 1 when side two is selected, etc. There may be even more "sides" when
it is a multiple-disk set.

I know this is a JavaScript question but, as I know nothing about
JavaScript, I am hoping that someone here might be able to help. I am
using CCS 3.2. Any ideas?

Thanks in advance.

Don (DonP)
DonB
Posted: 03/19/2008, 7:10 PM

jQuery solution: (get jquery-latest.js from http://jquery.com)

<html>
<head>
<script src="jquery/jquery-latest.js"></script>

<script type="text/javascript">
$(document).ready(function(){
$(".incr").change(function() {
$(this).nextAll("input").each(function(i) {
$(this).val(parseInt($(this).prevAll(".incr").val())+1);
});
});
});
</script>
</head>
<body>
<input class="incr" name="incr1" value="1"><br>
<input class="incr" name="incr2" value="2"><br>
<input class="incr" name="incr3" value="3"><br>
<input class="incr" name="incr4" value="4"><br>
<input class="incr" name="incr5" value="5"><br>
<input class="incr" name="incr6" value="6"><br>
<input class="incr" name="incr7" value="7"><br>
<input class="incr" name="incr8" value="8"><br>
<input class="incr" name="incr9" value="9"><br>
<input class="incr" name="incr10" value="10">
</body>
</html>

There are 10 input fields, entering a value in one sets all the others to
it's predecessor's value +1. Those before it are not affected.
--
DonB



"DonP" <forum@pc-homepage.com> wrote in message
news:frsaha$71q$1@news.codecharge.com...
>I have an editable grid used for selecting songs to assign them to a
>particular recording. One field is the one on which the grid is ordered,
>which is the order that the songs are on the recording. It is selected by a
>drop down but it is very tedious when there are many tracks (such as the 47
>track 3-disk CD that I entered yesterday!) so maybe there is a way that
>when the first one is selected, the others will increment by one and
>automatically make the proper selection. Additionally, there is another
>drop down where the "side" of the album is selected (these are often vinyl
>recordings) and I would like the order field to start over at 1 when side
>two is selected, etc. There may be even more "sides" when it is a
>multiple-disk set.
>
> I know this is a JavaScript question but, as I know nothing about
> JavaScript, I am hoping that someone here might be able to help. I am
> using CCS 3.2. Any ideas?
>
> Thanks in advance.
>
> Don (DonP)

DonP
Posted: 03/19/2008, 7:56 PM

Thanks! I looks to be exactly what I need but I am unsure how to apply
the modifications to the drop down list that CCS generates itself. Any
tips? Thanks again.

Don (DonP)

DonB wrote:
> jQuery solution: (get jquery-latest.js from http://jquery.com)
>
> <html>
> <head>
> <script src="jquery/jquery-latest.js"></script>
>
> <script type="text/javascript">
> $(document).ready(function(){
> $(".incr").change(function() {
> $(this).nextAll("input").each(function(i) {
> $(this).val(parseInt($(this).prevAll(".incr").val())+1);
> });
> });
> });
> </script>
> </head>
> <body>
> <input class="incr" name="incr1" value="1"><br>
> <input class="incr" name="incr2" value="2"><br>
> <input class="incr" name="incr3" value="3"><br>
> <input class="incr" name="incr4" value="4"><br>
> <input class="incr" name="incr5" value="5"><br>
> <input class="incr" name="incr6" value="6"><br>
> <input class="incr" name="incr7" value="7"><br>
> <input class="incr" name="incr8" value="8"><br>
> <input class="incr" name="incr9" value="9"><br>
> <input class="incr" name="incr10" value="10">
> </body>
> </html>
>
> There are 10 input fields, entering a value in one sets all the others to
> it's predecessor's value +1. Those before it are not affected.

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.