Thanks guys for all the help and suggestion, imagine i used readonly="readonly" instead of disabled="disabled" and it worked,
Lesson: when you doing calculations using javascript e.g you want to subtract some numbers using user inputbox, to avoid editing do not put disable as the db would not pick otherwise put readonly
Thanks
Calvin Omari
function setValue(controlName) {
controlName.selected = true;
}> type="hidden" name="amount2"
<input type="text"
> disabled="disabled" name="amount"
> id="amount" class="required" />
>
> <input
> id="amount2" value="true"/>
the first mistake is that you have to input types with the same name
let name the second one amount2
to assign the value do amount2.value = "assignn here the value you calculated"
the create a function eg:
this is where u need to set the field to true.
function setValue(controlName) {
controlName.selected = true;
}
then on submit add this onclick="setValue(amount2);"
this has always worked for me
******************************************** *nix is user friendly. It's just very particular about who it's friends are.
--- On Fri, 12/4/09, Calvin Omari <calvinebarongo@gmail.com> wrote:
> From: Calvin Omari <calvinebarongo@gmail.com>
> Subject: Re: [Skunkworks] capturing the javascript calculations in a mysql database PHP> Date: Friday, December 4, 2009, 11:45 AM
> To: "Skunkworks Forum" <skunkworks@lists.my.co.ke>
> Michael Your suggestion sounds easier I have
> tried having my text inputs this way but it still not
> working
> <input type="text"
> disabled="disabled" name="amount"
> id="amount" class="required" />
>
> <input
> type="hidden" name="amount"
> id="amount" value="true"/>
>
> Can you please check it for me,
> Thanks so much
>
> On Fri, Dec 4, 2009 at 12:12 PM,
> michael nyangweso <mnyangweso@yahoo.com>
> wrote:
>
> the trick is after doing the
> calculations and storing the values in a input or hidden
> field. it will display on the user side but when u submit
> the values will be blank. what u need is to set the value of
> the field to true when submitting the form
>
>
>
>
>
>
> --- On Fri, 12/4/09, Peter Karunyu <pkarunyu@gmail.com>
> wrote:
>
>
>
> > From: Peter Karunyu <pkarunyu@gmail.com>
>
> > Subject: Re: [Skunkworks] capturing the javascript
> calculations in a mysql database PHP
>
> > To: "Skunkworks Forum" <skunkworks@lists.my.co.ke>
>
> > Date: Friday, December 4, 2009, 10:51 AM
>
> > Aki, here's the
> interesting part, you
>
> > can save and output XML to and from mysql!
>
> > I can't think of any reason one would want to do
> that,
>
> > but that didn't stop MySQL AB in having
>
> > it in 5.1
>
> >
>
> >
>
> > On Fri, Dec 4, 2009 at 11:31 AM,
>
> > aki <aki275@googlemail.com>
>
> > wrote:
>
> >
>
> > On Fri, Dec 4,
>
> > 2009 at 11:07 AM, Calvin Omari <calvinebarongo@gmail.com>
>
> > wrote:
>
> >
>
> > TI used javascript because
>
> > that is what i know and that is just piece of the
> code, I
>
> > have database declarations and captured the inputs of
> which
>
> > are not entered into the database, I think the big
> issue is
>
> > how do i capture users entering data that is bound to
> be
>
> > calculated at a standard rate eg users to enter first
>
> > milleage reading then last milleage reading ,
> javascript or
>
> > any other to get the diffrence and then multiply by
> the rate
>
> > to get what he or she is supposed to be payed/pay
>
> >
>
> >
>
> >
>
> > Thanks again so much for your response
>
> >
>
> > @Calvin, lemme sharing an insight with you and
>
> > HTHs. 3 months ago, when drawing out the workflow and
> code
>
> > for the Mbytemeter program, I ran into issues with
> about
>
> > saving data. I had the options of using a SQL lite
> Db,
>
> > CSV or Excel file. The main problem I had was to store
> and
>
> > retrieve the data in an organized manner i.e each cell
> to
>
> > correspond with the data stored so that this data can
> be
>
> > retrieved by calls to that cell. So for example : In
>
> > Mybtemeter, it has an option to save Telco profiles.
> These
>
> > profiles contain data : Name , APN Value, UserName,
> Password
>
> > and DUN Number. When the program launches ( form load
> event
>
> > ) it would populate a Drop Down Box with the stored
>
> > profiles ( using a query ). Then the other issue was,
> how
>
> > small and open was my program? Thus, I set out on XML
> and I
>
> > think it was a good decision. I think XML is amazing.
> ( and
>
> > the journey continues )
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > _______________________________________________
>
> >
>
> > Skunkworks mailing list
>
> >
>
> > Skunkworks@lists.my.co.ke
>
> >
>
> > http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
>
> >
>
> > ------------
>
> >
>
> > Skunkworks Rules
>
> >
>
> > http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
>
> >
>
> > ------------
>
> >
>
> > Other services @ http://my.co.ke
>
> >
>
> > Other lists
>
> >
>
> > -------------
>
> >
>
> > Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
>
> >
>
> > Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
>
> >
>
> > kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
>
> >
>
> >
>
> >
>
> > -----Inline Attachment Follows-----
>
> >
>
> > _______________________________________________
>
> > Skunkworks mailing list
>
> > Skunkworks@lists.my.co.ke
>
> > http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
>
> > ------------
>
> > Skunkworks Rules
>
> > http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
>
> > ------------
>
> > Other services @ http://my.co.ke
>
> > Other lists
>
> > -------------
>
> > Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
>
> > Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
>
> > kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
>
>
>
>
>
>
>
> _______________________________________________
>
> Skunkworks mailing list
>
> Skunkworks@lists.my.co.ke
>
> http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
>
> ------------
>
> Skunkworks Rules
>
> http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
>
> ------------
>
> Other services @ http://my.co.ke
>
> Other lists
>
> -------------
>
> Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
>
> Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
>
> kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
>
>
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Skunkworks mailing list
> Skunkworks@lists.my.co.ke
> http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
> ------------
> Skunkworks Rules
> http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
> ------------
> Other services @ http://my.co.ke
> Other lists
> -------------
> Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
> Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
> kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general