Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Roger Brown: "Great product. The more I work with it, the more I am amazed at what it can do".
John Gondek: "Your software is amazing. I consider myself a novice at PHP and JS and with your software I have a web page that is truly fantastic. Thank you so much ".

More

Add your opinion

PostgreSQL PHP Generator online Help

Prev Return to chapter overview Next

setValue

Sets the value of a certain control. To get a control value, use the appropriate function.

 

Signature:

function setValue(value);

 

The examples below show how this method can be used in the OnInsertFormEditorValueChanged and OnEditFormEditorValueChanged event handlers.

 

Example 1:

The code below allows you to select a college only for players from U.S. (see this in action). See how it looks on the webpage at the screen below.

 

console.log(sender);

if (sender.getFieldName() == 'country_id')

{

  console.log(sender.getValue());

  editors['college_id'].enabled(sender.getValue() == 1);

  if (sender.getValue() != 1) { 

     editors['college_id'].setValue(null);

     $('#college_id_edit').next().show();

  }

  else

     $('#college_id_edit').next().hide();

 

 

Example 2:

Another example from the insert and edit forms of the Players page (see this in action). This piece of code allows you to select player number only if a player's team is already selected (in other words, players who do not belong to a team cannot have numbers).

 

if (sender.getFieldName() == 'current_team_id')

{

  if (sender.getValue() == '')

  {

    editors['current_number'].setValue('');

    editors['current_number'].enabled(false);  

    $('#current_number_edit').next().show();      

  }

  else

  {

    editors['current_number'].enabled(true);  

    $('#current_number_edit').next().hide();      

  }

}

 

 

See also: getValue



Prev Return to chapter overview Next