<RESOLVED> calculating an value (with some ajax?)

A place for users and developers of the Xataface to discuss and receive support.

<RESOLVED> calculating an value (with some ajax?)

Postby PolderBoy » Thu Aug 06, 2009 9:31 am

Clients newest wish:

When he selects from a pulldown menu in the "new" page the next field should be filled with a number.

Let me explain: When the user adds a new office in the program, the office_nr gets filled with a number (max + 1)

Code: Select all
   function KantoorID__default()
   {
      include("conf.php");

      $con = mysql_connect($host, $user, $password);

         if (!$con)
         {
            die('Could not connect: ' . mysql_error());
         }

      mysql_select_db($name, $con);
      
      $sql = "SELECT MAX(KantoorID) AS Hoogste FROM D2D";

         $result = mysql_query($sql);
         $row = mysql_fetch_array($result);
         $terug = $row['Hoogste'] + 1;

      mysql_close($con);

      return $terug;

   }


The above works for the adding of a new office but for a new client I need the value of a select box. (officeID + followNr example: 010001: office 01 client 0001)

When he adds a new client he must first select a office and regarding this office_ID the client_nr is calculated but how do I find the value he has selected in the pulldown before he has saved?

thanks in advance,

Polderboy
Last edited by PolderBoy on Mon Aug 10, 2009 6:33 am, edited 1 time in total.
PolderBoy
 
Posts: 72
Joined: Fri Apr 03, 2009 12:53 am

Postby Jean » Fri Aug 07, 2009 12:32 am

Hi,
May be, you could find a part of your answer in this post http://xataface.com/forum/viewtopic.php?t=4352
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

resolved

Postby PolderBoy » Mon Aug 10, 2009 6:33 am

Thanks Jean,

I think I have it working now:

In the fields.ini I have:

[OfficeNummer]
widget:atts:onblur="ContrNr_Check();"

Which is a function in the included javascript.
In this script I use the value of the selected pulldown(OfficeNummer)
to sent to a phpfile on the server. So that I can sent back the next free number to the script and this value is used to fill the next text box.

It is so easy, now I know how....

Thanks again.

Polderboy
PolderBoy
 
Posts: 72
Joined: Fri Apr 03, 2009 12:53 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 19 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved