Add Page Default Value 0

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mpol_ch
User
Posts: 877
Location: Switzerland

Add Page Default Value 0

Post by mpol_ch »

Hello

I am trying to set the default value for Add Page as "0". It deos not accept. When I set it to 1 or 90 it is not a problem. But 0 is not accepted. I have to set it to 0 because a auto calculation of an customer script.

Thanks
mpol_ch


danielc
User
Posts: 1601

Post by danielc »

What do you mean by "does not accept"? Is it "0" not display as default value at Add Page? Have you tried for another field to have default "0" at Add Page?

From your description, your field is integer field. It should accept any value include 0.

If you have server event, double check your code.


mobhar
User
Posts: 11750

Post by mobhar »

What is the type of the field and what database engine are you using?


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

Hello
Now I can use the "0" default. But When I save the value they are multipled with x100. Also when I same 8200 then I see in db and in edit mode the value 820000.
Hier my field:
Onetimecosts: Datatype Decimal 12 (MySQL Decimal (10,2))
Format: Number
No. of Digits.. 2

I am using the following script in startup.

Thanks for any hints.
mpol_ch

function showTotal() {


  // var Summe = parseFloat(document.getElementById("x_Onetimecosts").value);  
  var Summe= 0;
    var splitted                                      
  var elements = document.getElementsByName("x_Options[]");         
  for (i=0;i < elements.length;i++) {
  if (elements[i].checked) {                                                  
     splitted = elements[i].nextSibling.nodeValue.split(",");
     Summe = Summe+ + parseFloat(splitted[1]);                                                                 
  }                                                      
}                                                     
                                                                           
document.forderformadd.x_Sumoptions.value = Summe.toFixed(2);   
document.forderformadd.x_Sumprod.value = (parseFloat(document.getElementById("x_Onetimecosts").value) + Summe).toFixed(2);

digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Post by digitalphotoworld »

If the value is mulitplied with 100, there could be a problem with . and ,
Check the local settings. I had the same problem some days ago and could solve it this way.


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

Hello digitalphotoworld

thanks. Yes, it seems to be a language file problem. I am using the german language file.
I think I localised the problem and will do some tests.

thanks
mpol_ch


Post Reply