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

Subscribe to our news:
Partners
Testimonials
David Lantz: "Thank you, this is by far the simplest, and most friendly utility for building db record system I have ever used. I wish I could get my systems guys at the office to purchase this for our company would be so very helpful and speed up a lot of work. I for one have used it for everything from a simple inventory record of my house, to a members record for my church just little pet projects and a test bed to test my own db builds and theories before having to hand code at the office..... it is a lot of fun to work with".
George Westrup: "I have saved so much time using your products. Also you are quick to respond to every question I have had. Thanks for the great support".

More

Add your opinion

PHP Generator for MySQL 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