Re: [SLUG] Javascript Problem

From: Pete Theisen (petetheisen@verizon.net)
Date: Sun Oct 15 2006 - 23:10:11 EDT


On Sunday 15 October 2006 22:51, Paul M Foster wrote:
> Daniel Jarboe wrote:
> > Ruby on Rails is way overkill for this... this is pretty basic
> > client-side javascript functionality
> >
> > quick and dirty version below, season to taste
> >
> > <script type="text/javascript">
> > function update(source)
> > { var i,number,temp=""
> > // valid number, no-decimal
> > if ( !isNaN(source.value) && (source.value.indexOf(".")==-1) &&
> > // assign value to number and test greater than 0
> > (number=parseInt(source.value,10))>0 )
> > { for (i=0;i<number;i++)
> > temp+="<input type='text' name='value"+i+"'><br>"
> > document.getElementById("updateMe").innerHTML=temp
> > }
> > else
> > alert("Error: Positive integer required")
> > }
> > </script>
> > <form>
> > How many? <input type=text onchange="update(this)">
> > <div id="updateMe">
> > </div>
> > </form>
>
> Thanks. This works as advertised, though minor changes break it. Hmm.
>
> It's all part of a large project to transfer our invoicing and such from
> FoxPro to PHP/PostgreSQL. Under the circumstances, AJAX and Javascript
> appear to be the ideal solutions to certain problems. I'm just not
> conversant enough with those technologies. So I'm trying to get a leg up
> (or two).

Hi Paul!

If it is in FoxPro now, pose the question on <profox@leafe.com> and see what
answers you get there. Free to subscribe to ProFox. If you hate off-topic
subscribe to the tech version, off-topic posts are filtered out.

Regards,

Pete
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:00:02 EDT