Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

forms-dev

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 181 - 210 of 946   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#181 From: Manuel Lemos <mlemos@...>
Date: Thu Aug 25, 2005 4:33 pm
Subject: Re: Linked Select Value Not Passing Problem
mallemos
Send Email Send Email
 
Hello,

on 08/25/2005 01:23 PM operationsengineer1@... said the following:
> the problem i'm having now is that the linked select
> box isn't passing a value.  in my case, my parent link
> is assembly number and child link is serial number.
> the serial number value isn't passing via
> POST['serial_number'].
>
> the serial number values display just fine.
>
> i did a print_r() on assembly_number:
>
> Array ( [] => Enter Assembly Number [5] => 02 )
>
> and on serial number:
>
> Array ( [] => Array ( [] => Enter Serial Number ) [5]
> => Array ( [] => Choose Serial Number [1] => 1 [2] =>
> 2 [3] => 3 [4] => 4 [5] => 5 ) )
>
> does this look correct?  i have one assembly number
> (02) with associated serial numbers (1,2,3,4,5).
>
> i definitely select the serial number with my mouse
> when filling out the form, but the id will not display
> when i echo it after checking that the "doit" submit
> button was checked.

There was a bug in the linked select plug-in class that affected it when
the options used were numeric. The bug was fixed in the latest release
some time ago. Just download it and you should have no more problems.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#182 From: <operationsengineer1@...>
Date: Thu Aug 25, 2005 5:24 pm
Subject: Re: Linked Select Value Not Passing Problem
operationsen...
Send Email Send Email
 
hi Manuel,

i downloaded the latest and greatest a few minutes
ago.  the value of the linked select still does not
pass through.

$form->AddInput(array(
     'TYPE'=>'custom',
     'NAME'=>'serial_number',
     'ID'=>'serial_number',
     'CustomClass'=>'form_linked_select_class',
     'VALUE'=>$first_serial_number_id,
     'Groups'=>$groups_serial_number,
     'SIZE'=>4,
     'STYLE'=>'width:14.5em;',
     'LinkedInput'=>'product',
     'LABEL'=>'Serial Number',
     'TABINDEX'=>4,
	 'ValidateAsNotEmpty'=>1,
     'ValidationErrorMessage'=>'you must enter the
serial number'
));

once i check for "doit" submission, this code yields
emptyness...

echo '<br/>'.$serial_number_id =
$_POST['serial_number'];

(i test all values - all other form elements yield
their correct values).

i think my code is right (no typos, etc.).

everything in the form displays very nicely, though,
so that leads me to believe the arrays are structured
correctly and the id is available to pass.

is there extra code required to pass the linked select
value due to its being linked or should it pass like
any other form elements once it has been selected?

tia...


--- Manuel Lemos <mlemos@...> wrote:

> Hello,
>
> on 08/25/2005 01:23 PM operationsengineer1@...
> said the following:
> > the problem i'm having now is that the linked
> select
> > box isn't passing a value.  in my case, my parent
> link
> > is assembly number and child link is serial
> number.
> > the serial number value isn't passing via
> > POST['serial_number'].
> >
> > the serial number values display just fine.
> >
> > i did a print_r() on assembly_number:
> >
> > Array ( [] => Enter Assembly Number [5] => 02 )
> >
> > and on serial number:
> >
> > Array ( [] => Array ( [] => Enter Serial Number )
> [5]
> > => Array ( [] => Choose Serial Number [1] => 1 [2]
> =>
> > 2 [3] => 3 [4] => 4 [5] => 5 ) )
> >
> > does this look correct?  i have one assembly
> number
> > (02) with associated serial numbers (1,2,3,4,5).
> >
> > i definitely select the serial number with my
> mouse
> > when filling out the form, but the id will not
> display
> > when i echo it after checking that the "doit"
> submit
> > button was checked.
>
> There was a bug in the linked select plug-in class
> that affected it when
> the options used were numeric. The bug was fixed in
> the latest release
> some time ago. Just download it and you should have
> no more problems.
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components
> written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other
> products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer
> generator
> http://www.meta-language.net/metastorage.html
>




____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs

#183 From: Manuel Lemos <mlemos@...>
Date: Thu Aug 25, 2005 6:29 pm
Subject: Re: Linked Select Value Not Passing Problem
mallemos
Send Email Send Email
 
Hello,

on 08/25/2005 02:24 PM operationsengineer1@... said the following:
> $form->AddInput(array(
>     'TYPE'=>'custom',
>     'NAME'=>'serial_number',
>     'ID'=>'serial_number',
>     'CustomClass'=>'form_linked_select_class',
>     'VALUE'=>$first_serial_number_id,
>     'Groups'=>$groups_serial_number,
>     'SIZE'=>4,
>     'STYLE'=>'width:14.5em;',
>     'LinkedInput'=>'product',
>     'LABEL'=>'Serial Number',
>     'TABINDEX'=>4,
>  'ValidateAsNotEmpty'=>1,
>     'ValidationErrorMessage'=>'you must enter the
> serial number'
> ));
>
> once i check for "doit" submission, this code yields
> emptyness...
>
> echo '<br/>'.$serial_number_id =
> $_POST['serial_number'];

Of course. That is not the way to get the input value. What you should
use is to call the form function GetInputValue('serial_number') after
calling LoadInputValues and Validate .


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#184 From: <operationsengineer1@...>
Date: Thu Aug 25, 2005 6:57 pm
Subject: Re: Linked Select Value Not Passing Problem
operationsen...
Send Email Send Email
 
$serial_number=$form->GetInputValue('serial_number');

worked like a charm!  thanks.

i've been using the $_POST method to get my values on
form submission.  it has always worked up until now.

is there a compelling reason to use GetInputValue()
over $_POST when both methods work or should i just
use GetInputValue() in a case like this where $_POST
won't work?

thanks again...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#185 From: Manuel Lemos <mlemos@...>
Date: Thu Aug 25, 2005 7:39 pm
Subject: Re: Linked Select Value Not Passing Problem
mallemos
Send Email Send Email
 
Hello,

on 08/25/2005 03:57 PM operationsengineer1@... said the following:
> $serial_number=$form->GetInputValue('serial_number');
>
> worked like a charm!  thanks.
>
> i've been using the $_POST method to get my values on
> form submission.  it has always worked up until now.
>
> is there a compelling reason to use GetInputValue()
> over $_POST when both methods work or should i just
> use GetInputValue() in a case like this where $_POST
> won't work?

Using the function is the recommended way. What you did is not supported
as you have seen it may not work using $_POST. Depeding on your php.ini
settings the class may perform adjustments to the loaded values like
removing escape characters, discarding invalid values, apply the
requested server side transformations, etc..

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#186 From: <operationsengineer1@...>
Date: Thu Aug 25, 2005 9:54 pm
Subject: GetInputValue() & SQL Injection
operationsen...
Send Email Send Email
 
hi Manueal,

how good a job does GetInputValue() do in preventing
SQL injection attacks?

is there anything else i should do to protect myself
beyond using GetInputValue() instead of $_POST?

as always...  tia...



__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail

#187 From: Manuel Lemos <mlemos@...>
Date: Thu Aug 25, 2005 11:07 pm
Subject: Re: GetInputValue() & SQL Injection
mallemos
Send Email Send Email
 
Hello,

on 08/25/2005 06:54 PM operationsengineer1@... said the following:
> how good a job does GetInputValue() do in preventing
> SQL injection attacks?

> is there anything else i should do to protect myself
> beyond using GetInputValue() instead of $_POST?

The forms class has nothing to do with SQL queries. However, you should
not use any values from forms before they are validated.

If you expect that certain values from form inputs be a of certain type,
you should use the necessary validation rules to prevent that invalid
values  be accepted and used to exploit your applications.

For instance, if you expect that a field contains an integer, just use
ValidateAsInteger parameter, call Validate and then GetInputValue to use
it in any queries.

Also if you are passing contextual values in hidden fields, it does not
make much sense to tell the user that the values are invalid because he
will not be able to fix values in hidden fields.


In that case you can simply tell the forms class to silently discard any
invalid values using the DiscardInvalidValues parameter in conjunction
with other Validation parameters.

This may save you from exploits cause by forged values passed as hidden
fields. The main example script test_form.php shows an example of usage.

Anyway, most SQL injection exploits are cause by the use of values in
SQL queries that are not properly escaped. Escaping values is not the
purpose of the form class because it depends on your purpose.

For SQL queries there is not a single solution as each database performs
escaping in their own way. AddSlashes only works for text values with
some databases.

For a database independent solution, you may want to look at Metabase
with a database abstraction package focused on total database
application portability. It works with many databases and among many
other portability features, it provide data type value mapping. This
means that for text values it can escape such values correctly according
to each database, but it also provides proper mapping of values of other
database data types.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#188 From: <operationsengineer1@...>
Date: Thu Aug 25, 2005 11:13 pm
Subject: Re: GetInputValue() & SQL Injection
operationsen...
Send Email Send Email
 
thanks a lot for the great information.

--- Manuel Lemos <mlemos@...> wrote:

> Hello,
>
> on 08/25/2005 06:54 PM operationsengineer1@...
> said the following:
> > how good a job does GetInputValue() do in
> preventing
> > SQL injection attacks?
>
> > is there anything else i should do to protect
> myself
> > beyond using GetInputValue() instead of $_POST?
>
> The forms class has nothing to do with SQL queries.
> However, you should
> not use any values from forms before they are
> validated.
>
> If you expect that certain values from form inputs
> be a of certain type,
> you should use the necessary validation rules to
> prevent that invalid
> values  be accepted and used to exploit your
> applications.
>
> For instance, if you expect that a field contains an
> integer, just use
> ValidateAsInteger parameter, call Validate and then
> GetInputValue to use
> it in any queries.
>
> Also if you are passing contextual values in hidden
> fields, it does not
> make much sense to tell the user that the values are
> invalid because he
> will not be able to fix values in hidden fields.
>
>
> In that case you can simply tell the forms class to
> silently discard any
> invalid values using the DiscardInvalidValues
> parameter in conjunction
> with other Validation parameters.
>
> This may save you from exploits cause by forged
> values passed as hidden
> fields. The main example script test_form.php shows
> an example of usage.
>
> Anyway, most SQL injection exploits are cause by the
> use of values in
> SQL queries that are not properly escaped. Escaping
> values is not the
> purpose of the form class because it depends on your
> purpose.
>
> For SQL queries there is not a single solution as
> each database performs
> escaping in their own way. AddSlashes only works for
> text values with
> some databases.
>
> For a database independent solution, you may want to
> look at Metabase
> with a database abstraction package focused on total
> database
> application portability. It works with many
> databases and among many
> other portability features, it provide data type
> value mapping. This
> means that for text values it can escape such values
> correctly according
> to each database, but it also provides proper
> mapping of values of other
> database data types.
>
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components
> written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other
> products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer
> generator
> http://www.meta-language.net/metastorage.html
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#189 From: "Kike Becerra" <qbecerra@...>
Date: Fri Aug 26, 2005 2:02 am
Subject: Extension for class
qbecerra
Send Email Send Email
 
Hi guys...
Has any1 tried adding HTMLArea, FCKEditor, or another WYSIWYG editor
(custom textarea) to formsgen class ?

I'd love to have some of above integrated to formsgen...

Thanks 4 reading... cya l8r

#190 From: Manuel Lemos <mlemos@...>
Date: Fri Aug 26, 2005 2:42 am
Subject: Re: Extension for class
mallemos
Send Email Send Email
 
Hello,

on 08/25/2005 11:02 PM Kike Becerra said the following:
> Hi guys...
> Has any1 tried adding HTMLArea, FCKEditor, or another WYSIWYG editor
> (custom textarea) to formsgen class ?
>
> I'd love to have some of above integrated to formsgen...

It is in my to do list. Anyway, it is a bit dangerous to accept HMTL as
input. It is better to have some kind of validation that discards
cross-site scripting exploits. I would like to develop a custom plugin
for FCKeditor but without proper validation to filter tags, it would be
dangerous to use, not because of FCKeditor but because people may forge
bogus HTML to exploit your site.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#191 From: Albert Padley <apadley@...>
Date: Fri Aug 26, 2005 2:42 am
Subject: Re: Extension for class
albertp3
Send Email Send Email
 
It just so happens that I was working on one today - TinyMCE - http://
www.moxiecode.com/

So far no problems related to formsgen.

Albert Padley


On Aug 25, 2005, at 8:02 PM, Kike Becerra wrote:

> Hi guys...
> Has any1 tried adding HTMLArea, FCKEditor, or another WYSIWYG editor
> (custom textarea) to formsgen class ?
>
> I'd love to have some of above integrated to formsgen...
>
> Thanks 4 reading... cya l8r
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor --------------------
> ~-->
> <font face=arial size=-1><a href="http://us.ard.yahoo.com/
> SIG=12heh00t7/M=362335.6886445.7839731.1510227/D=groups/
> S=1705006764:TM/Y=YAHOO/EXP=1125028942/A=2894361/R=0/SIG=13jmebhbo/
> *http://www.networkforgood.org/topics/education/digitaldivide/?
> source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income
> neighborhoods, 84% do not own computers. At Network for Good, help
> bridge the Digital Divide!</a>.</font>
> --------------------------------------------------------------------
> ~->
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>

#192 From: Albert Padley <apadley@...>
Date: Fri Aug 26, 2005 2:48 am
Subject: Re: Extension for class
albertp3
Send Email Send Email
 
Of course, Manuel is correct about the need for proper validation. I
only use TinyMCE in an application where I know the people doing the
input. Even then, all the input is scrubbed before being added to the
database.

Albert Padley


On Aug 25, 2005, at 8:42 PM, Manuel Lemos wrote:

> Hello,
>
> on 08/25/2005 11:02 PM Kike Becerra said the following:
>
>> Hi guys...
>> Has any1 tried adding HTMLArea, FCKEditor, or another WYSIWYG editor
>> (custom textarea) to formsgen class ?
>>
>> I'd love to have some of above integrated to formsgen...
>>
>
> It is in my to do list. Anyway, it is a bit dangerous to accept
> HMTL as
> input. It is better to have some kind of validation that discards
> cross-site scripting exploits. I would like to develop a custom plugin
> for FCKeditor but without proper validation to filter tags, it
> would be
> dangerous to use, not because of FCKeditor but because people may
> forge
> bogus HTML to exploit your site.
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html
>
>
> ------------------------ Yahoo! Groups Sponsor --------------------
> ~-->
> Fair play? Video games influencing politics. Click and talk back!
> http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/saFolB/TM
> --------------------------------------------------------------------
> ~->
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>

#193 From: Manuel Lemos <mlemos@...>
Date: Fri Aug 26, 2005 3:00 am
Subject: Re: Extension for class
mallemos
Send Email Send Email
 
Hello,

on 08/25/2005 11:42 PM Albert Padley said the following:
> It just so happens that I was working on one today - TinyMCE - http://
> www.moxiecode.com/
>
> So far no problems related to formsgen.

Right, integration should be simple for this kind of inputs as they only
   act as textarea replacements.

Feel free to submit your plug-in class to the PHP Classes site as your
own package. I am sure it will be very well appreciated.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#194 From: Manuel Lemos <mlemos@...>
Date: Fri Aug 26, 2005 3:04 am
Subject: Re: Extension for class
mallemos
Send Email Send Email
 
Hello,

on 08/25/2005 11:48 PM Albert Padley said the following:
> Of course, Manuel is correct about the need for proper validation. I
> only use TinyMCE in an application where I know the people doing the
> input. Even then, all the input is scrubbed before being added to the
> database.

Right, some DTD or XML schema HTML validation based should solve the
problem.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#195 From: "Kike Becerra" <qbecerra@...>
Date: Sat Aug 27, 2005 8:00 pm
Subject: Linked Selects -> Modify input data
qbecerra
Send Email Send Email
 
Hi Manuel...
I could make linked selects to work great for a country/state form...
The insertion works great, now:

Suppose you Choose:

Italy for countryfield
Roma for statefield

Then, you post form, record gets inserted, etc. but...

¿ What happens if you would like to mod that form ?

What should I do or modify in the code I made to show the user which
country/state he selected in the insertion process ?

Thanks a lot in advance.

#196 From: <operationsengineer1@...>
Date: Sat Aug 27, 2005 11:38 pm
Subject: Re: Linked Selects -> Modify input data
operationsen...
Send Email Send Email
 
--- Kike Becerra <qbecerra@...> wrote:

> Hi Manuel...
> I could make linked selects to work great for a
> country/state form...
> The insertion works great, now:
>
> Suppose you Choose:
>
> Italy for countryfield
> Roma for statefield
>
> Then, you post form, record gets inserted, etc.
> but...
>
> ¿ What happens if you would like to mod that form ?
>
> What should I do or modify in the code I made to
> show the user which
> country/state he selected in the insertion process ?
>
> Thanks a lot in advance.

Kike,

this wasn't directed at me, but i like to give back
when i can.

as i understand it, you want the user to enter the
data, you want to process it and then you want to
display the input to the user, correct?

it will depend on your form set up.  i have a logic
page and a content page.

i use sessions to do this (you can google php sessions
tutorials, some are quite good).  i usually do my db
work, set my session variables and call header() to
the same page (using a constant that i set at the top
of my page).

on my content page (which i include into my code page
when i want to display something), i check if the
session variables are set and, if so, i display them
and then unset them so they won't display again unless
set again.  i then display the form for more data
entry.

i hope this helps.

if you need specific code help, just ask.  i will
likely be able to provide it monday when i crack open
my dev laptop again.



____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs

#197 From: Manuel Lemos <mlemos@...>
Date: Mon Aug 29, 2005 2:30 am
Subject: Re: Linked Selects -> Modify input data
mallemos
Send Email Send Email
 
Hello,

on 08/27/2005 05:00 PM Kike Becerra said the following:
> What should I do or modify in the code I made to show the user which
> country/state he selected in the insertion process ?

I am not sure what exactly do you want to do.

Do you want to show an additional linked select to show the users that
insert new records?

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#198 From: <operationsengineer1@...>
Date: Mon Aug 29, 2005 7:22 pm
Subject: Re: Linked Selects -> Modify input data
operationsen...
Send Email Send Email
 
--- Kike Becerra <qbecerra@...> wrote:

> Hi Manuel...
> I could make linked selects to work great for a
> country/state form...
> The insertion works great, now:
>
> Suppose you Choose:
>
> Italy for countryfield
> Roma for statefield
>
> Then, you post form, record gets inserted, etc.
> but...
>
> ¿ What happens if you would like to mod that form ?
>
> What should I do or modify in the code I made to
> show the user which
> country/state he selected in the insertion process ?
>
> Thanks a lot in advance.

Kike,

i think i know why you asked the question...  Manuel's
test_linked_select_page.html page actually does
display the results when you have Apache/PHP running
on your system.  if you don't, then you see the
javascript changes, but you won't see Manuel's answer
page b/c you don't have Apache/PHP running on your
system.

Fire up Apache and PHP on your system and it should
display the chosen results - which is what i think you
want.

Manuel's methodology and my methodology have some
significant differences.  based on my method, i would
choose to use sessions as i explained earlier.

keep in mind that Manuel is light years ahead of me
wrt to PHP programming knowledge and experience.  even
though i use a different approach, i wouldn't be very
far along without Manuel's generous help.

in the end, though, it is whatever works best for you.
  try Manuel's method.  try your own method.  see what
works best for your thought process.

good luck.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#199 From: <operationsengineer1@...>
Date: Tue Aug 30, 2005 9:44 pm
Subject: Triple Sec... errrr, Triple Select
operationsen...
Send Email Send Email
 
no question this time, just want to post the code
required to take the recordset and fill the three
arrays used to populate the selects (using ADOdb, make
adjustments depending on what db abstraction layer or
API you use)...

$continent=array(''=>'Select Continent');
$country = array('' => array(''=>'Select Country'));
$location = array('' => array(''=>'Select Location'));

while (!$rs_location->EOF)
{
  $continent_id = $rs_product_sn_test->fields[0];
  $country_id = $rs_product_sn_test->fields[2];
  $location_id = $rs_product_sn_test->fields[4];

  if(!isset($continent[$continent_id]))
  {
   $continent[$continent_id]=$rs_location->fields[1];
   $country[$continent_id] = array (''=>'Choose
Country');
  }
  if(!isset($country[$contienent_id][$country_id]))
  {

$country[$continent_id][$country_id]=$rs_location->fields[3];
   $location[$country_id] = array (''=>'Choose
Location');
  }

$location[$country_id][$location_id]=$rs_location->fields[5];

  $rs_location->MoveNext();
}

this was a little tough to format.  i also took it
from my working model and converted it into the
continent, country and location theme - so i hope i
didn't make any typos.

best of luck to any newbie trying this out.



____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs

#200 From: "Kike Becerra" <qbecerra@...>
Date: Wed Aug 31, 2005 12:38 am
Subject: Re: Linked Selects -> Modify input data
qbecerra
Send Email Send Email
 
Hi again
I've 3 operations in my clients db:
- Add
- Modify
- Delete

If user chooses ADD, i generate the form with the linked selects.
User chooses country=EEUU then (after 2nd select fills) he chooses
state=Chicago and then presses add button, and info is stored in db.

If user chooses MODIFY, then I must generate another form, with the
difference that fields should not be blank, but filled with data from
the record that must be modified

So, if user originally choosed country=EEUU & state=Chicago, how could
I do for having this automatically set in the 2 linked selects ?
I mean: instead of seeing
Country: -= SELECT A COUNTRY =-
State: -= SELECT A STATE =-

I should have
Country: EEUU
State: CHICAGO

and these 2 fields should be also linked... like the form for adding a
new record...

Hope you've understood me, and sorry 4 my english...
Thanks a lot for helping


--- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@a...> wrote:
> Hello,
>
> on 08/27/2005 05:00 PM Kike Becerra said the following:
> > What should I do or modify in the code I made to show the user which
> > country/state he selected in the insertion process ?
>
> I am not sure what exactly do you want to do.
>
> Do you want to show an additional linked select to show the users that
> insert new records?
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html

#201 From: Manuel Lemos <mlemos@...>
Date: Wed Aug 31, 2005 3:32 am
Subject: Re: Re: Linked Selects -> Modify input data
mallemos
Send Email Send Email
 
Hello,

on 08/30/2005 09:38 PM Kike Becerra said the following:
> Hi again
> I've 3 operations in my clients db:
> - Add
> - Modify
> - Delete
>
> If user chooses ADD, i generate the form with the linked selects.
> User chooses country=EEUU then (after 2nd select fills) he chooses
> state=Chicago and then presses add button, and info is stored in db.
>
> If user chooses MODIFY, then I must generate another form, with the
> difference that fields should not be blank, but filled with data from
> the record that must be modified
>
> So, if user originally choosed country=EEUU & state=Chicago, how could
> I do for having this automatically set in the 2 linked selects ?
> I mean: instead of seeing
> Country: -= SELECT A COUNTRY =-
> State: -= SELECT A STATE =-
>
> I should have
> Country: EEUU
> State: CHICAGO
>
> and these 2 fields should be also linked... like the form for adding a
> new record...

You just need to set the VALUE property of each select. Each linked
select input will pick the initial group from the VALUE of its predecessor.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#202 From: "Kike Becerra" <qbecerra@...>
Date: Mon Sep 5, 2005 2:52 pm
Subject: Re: Linked Selects -> Modify input data
qbecerra
Send Email Send Email
 
Hi again Manuel
I got your reply, and well...

When user clicks "modify record" the form shows again, with the linked
selects, all right, but well, I want to assign a predetermined value
to the select, but the VALUE property it is already assigned with this
code, which fills the select

"VALUE"=>Key($paises),

And I'd like to:
1- Fill each select
2- And after 1) assign a value (from its list) to each select

"VALUE"=>$value_user_has_in_its_record;

Hope you've understood my idea...

Thanks a lot for helping


--- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@a...> wrote:
> Hello,
>
> on 08/30/2005 09:38 PM Kike Becerra said the following:
> > Hi again
> > I've 3 operations in my clients db:
> > - Add
> > - Modify
> > - Delete
> >
> > If user chooses ADD, i generate the form with the linked selects.
> > User chooses country=EEUU then (after 2nd select fills) he chooses
> > state=Chicago and then presses add button, and info is stored in db.
> >
> > If user chooses MODIFY, then I must generate another form, with the
> > difference that fields should not be blank, but filled with data from
> > the record that must be modified
> >
> > So, if user originally choosed country=EEUU & state=Chicago, how could
> > I do for having this automatically set in the 2 linked selects ?
> > I mean: instead of seeing
> > Country: -= SELECT A COUNTRY =-
> > State: -= SELECT A STATE =-
> >
> > I should have
> > Country: EEUU
> > State: CHICAGO
> >
> > and these 2 fields should be also linked... like the form for adding a
> > new record...
>
> You just need to set the VALUE property of each select. Each linked
> select input will pick the initial group from the VALUE of its
predecessor.
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html

#203 From: "Kike Becerra" <qbecerra@...>
Date: Mon Sep 5, 2005 3:03 pm
Subject: Re: Linked Selects -> Modify input data
qbecerra
Send Email Send Email
 
Hi again
Please ignore/delete my last message
I thought the VALUE option for select was the one which served to fill
the select with values, but I noticed that OPTIONS was really for this...
I assigned VALUE=>$field

And everything went ok

Thanks !!!


--- In forms-dev@yahoogroups.com, "Kike Becerra" <qbecerra@y...> wrote:
> Hi again Manuel
> I got your reply, and well...
>
> When user clicks "modify record" the form shows again, with the linked
> selects, all right, but well, I want to assign a predetermined value
> to the select, but the VALUE property it is already assigned with this
> code, which fills the select
>
> "VALUE"=>Key($paises),
>
> And I'd like to:
> 1- Fill each select
> 2- And after 1) assign a value (from its list) to each select
>
> "VALUE"=>$value_user_has_in_its_record;
>
> Hope you've understood my idea...
>
> Thanks a lot for helping
>
>
> --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@a...> wrote:
> > Hello,
> >
> > on 08/30/2005 09:38 PM Kike Becerra said the following:
> > > Hi again
> > > I've 3 operations in my clients db:
> > > - Add
> > > - Modify
> > > - Delete
> > >
> > > If user chooses ADD, i generate the form with the linked selects.
> > > User chooses country=EEUU then (after 2nd select fills) he chooses
> > > state=Chicago and then presses add button, and info is stored in db.
> > >
> > > If user chooses MODIFY, then I must generate another form, with the
> > > difference that fields should not be blank, but filled with data
from
> > > the record that must be modified
> > >
> > > So, if user originally choosed country=EEUU & state=Chicago, how
could
> > > I do for having this automatically set in the 2 linked selects ?
> > > I mean: instead of seeing
> > > Country: -= SELECT A COUNTRY =-
> > > State: -= SELECT A STATE =-
> > >
> > > I should have
> > > Country: EEUU
> > > State: CHICAGO
> > >
> > > and these 2 fields should be also linked... like the form for
adding a
> > > new record...
> >
> > You just need to set the VALUE property of each select. Each linked
> > select input will pick the initial group from the VALUE of its
> predecessor.
> >
> > --
> >
> > Regards,
> > Manuel Lemos
> >
> > PHP Classes - Free ready to use OOP components written in PHP
> > http://www.phpclasses.org/
> >
> > PHP Reviews - Reviews of PHP books and other products
> > http://www.phpclasses.org/reviews/
> >
> > Metastorage - Data object relational mapping layer generator
> > http://www.meta-language.net/metastorage.html

#204 From: "Kike Becerra" <qbecerra@...>
Date: Mon Sep 5, 2005 3:26 pm
Subject: Re: Linked Selects -> Modify input data
qbecerra
Send Email Send Email
 
Hi again (lol)

I've the 2 linked selects...
When I modify a record, I set the value of the 1º select and it works,
but when I try to assign a value to the 2º select, it doesn't work...

What's wrong ?
Here i post the code for the 2º select...
When I see the form, the 1º select is with the corresponding option
selected, but the 2º select is with the 1º option..

$form->AddInput(array(
	 "TYPE"=>"custom",
	 "ID"=>"campoprovincia",
	 "NAME"=>"campoprovincia",
	 "LABEL"=>"Localidad: ",
	 "CustomClass"=>"form_linked_select_class",
	 "VALUE"=>$camponombreloc,
	 "SIZE"=>1,
	 "Groups"=>$provin,
	 "LinkedInput"=>"campopais",
	 "ValidateAsNotEmpty"=>1,
	 "ValidationErrorMessage"=>"Seleccione una localidad"
));

Thanks...


--- In forms-dev@yahoogroups.com, "Kike Becerra" <qbecerra@y...> wrote:
> Hi again
> Please ignore/delete my last message
> I thought the VALUE option for select was the one which served to fill
> the select with values, but I noticed that OPTIONS was really for
this...
> I assigned VALUE=>$field
>
> And everything went ok
>
> Thanks !!!
>
>
> --- In forms-dev@yahoogroups.com, "Kike Becerra" <qbecerra@y...> wrote:
> > Hi again Manuel
> > I got your reply, and well...
> >
> > When user clicks "modify record" the form shows again, with the linked
> > selects, all right, but well, I want to assign a predetermined value
> > to the select, but the VALUE property it is already assigned with this
> > code, which fills the select
> >
> > "VALUE"=>Key($paises),
> >
> > And I'd like to:
> > 1- Fill each select
> > 2- And after 1) assign a value (from its list) to each select
> >
> > "VALUE"=>$value_user_has_in_its_record;
> >
> > Hope you've understood my idea...
> >
> > Thanks a lot for helping
> >
> >
> > --- In forms-dev@yahoogroups.com, Manuel Lemos <mlemos@a...> wrote:
> > > Hello,
> > >
> > > on 08/30/2005 09:38 PM Kike Becerra said the following:
> > > > Hi again
> > > > I've 3 operations in my clients db:
> > > > - Add
> > > > - Modify
> > > > - Delete
> > > >
> > > > If user chooses ADD, i generate the form with the linked selects.
> > > > User chooses country=EEUU then (after 2nd select fills) he chooses
> > > > state=Chicago and then presses add button, and info is stored
in db.
> > > >
> > > > If user chooses MODIFY, then I must generate another form,
with the
> > > > difference that fields should not be blank, but filled with data
> from
> > > > the record that must be modified
> > > >
> > > > So, if user originally choosed country=EEUU & state=Chicago, how
> could
> > > > I do for having this automatically set in the 2 linked selects ?
> > > > I mean: instead of seeing
> > > > Country: -= SELECT A COUNTRY =-
> > > > State: -= SELECT A STATE =-
> > > >
> > > > I should have
> > > > Country: EEUU
> > > > State: CHICAGO
> > > >
> > > > and these 2 fields should be also linked... like the form for
> adding a
> > > > new record...
> > >
> > > You just need to set the VALUE property of each select. Each linked
> > > select input will pick the initial group from the VALUE of its
> > predecessor.
> > >
> > > --
> > >
> > > Regards,
> > > Manuel Lemos
> > >
> > > PHP Classes - Free ready to use OOP components written in PHP
> > > http://www.phpclasses.org/
> > >
> > > PHP Reviews - Reviews of PHP books and other products
> > > http://www.phpclasses.org/reviews/
> > >
> > > Metastorage - Data object relational mapping layer generator
> > > http://www.meta-language.net/metastorage.html

#205 From: <operationsengineer1@...>
Date: Wed Sep 7, 2005 5:58 pm
Subject: Four Level Linked Select Boxes Inconsistent Behavior
operationsen...
Send Email Send Email
 
hi Manuel,

i've set up 4 linked selects.  however, i've run into
an issue you may be able to help with.  when i select
the first select, the second select auto populates
with values.  this is also true of the second and
third selects, respectively.

when i select from the third select, though, the
fourth select does not auto populate.

when i click on the third select's update button,
though, it populates the fourth select box.

is this something i'm doing or could this be something
in the forms class that results in this inconsistent
behavior when a four level linked select is used?

tia...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#206 From: <operationsengineer1@...>
Date: Wed Sep 7, 2005 6:17 pm
Subject: Re: Re: Linked Selects -> Modify input data
operationsen...
Send Email Send Email
 
Kike,

i can't help much here other to say i think this is
supposed to be Manuel's answer (from prior post)...

---
You just need to set the VALUE property of each
select. Each linked select input will pick the initial
group from the VALUE of its predecessor.
---

i'm not working through this issue (yet!), so the
above doesn't make too much sense to me - especially
my inference that the values somehow cascade through
the linked selects.

assuming i'm understanding you correctly...

i assume you have variables that you use to send
information to your db.  you could create a session
and pass those variables to the next page and then
assign the appropriate SESSION variable (used to be db
input variables in prior page) to the appropriate form
element's VALUE value.

the VALUE for each element should equal the entry
entry into the db.

depending on your setup you may be able to do this
with the POST variables.

--- Kike Becerra <qbecerra@...> wrote:

> Hi again (lol)
>
> I've the 2 linked selects...
> When I modify a record, I set the value of the 1º
> select and it works,
> but when I try to assign a value to the 2º select,
> it doesn't work...
>
> What's wrong ?
> Here i post the code for the 2º select...
> When I see the form, the 1º select is with the
> corresponding option
> selected, but the 2º select is with the 1º option..
>
> $form->AddInput(array(
>  "TYPE"=>"custom",
>  "ID"=>"campoprovincia",
>  "NAME"=>"campoprovincia",
>  "LABEL"=>"Localidad: ",
>  "CustomClass"=>"form_linked_select_class",
>  "VALUE"=>$camponombreloc,
>  "SIZE"=>1,
>  "Groups"=>$provin,
>  "LinkedInput"=>"campopais",
>  "ValidateAsNotEmpty"=>1,
>  "ValidationErrorMessage"=>"Seleccione una
> localidad"
> ));
>
> Thanks...
>
>
> --- In forms-dev@yahoogroups.com, "Kike Becerra"
> <qbecerra@y...> wrote:
> > Hi again
> > Please ignore/delete my last message
> > I thought the VALUE option for select was the one
> which served to fill
> > the select with values, but I noticed that OPTIONS
> was really for
> this...
> > I assigned VALUE=>$field
> >
> > And everything went ok
> >
> > Thanks !!!
> >
> >
> > --- In forms-dev@yahoogroups.com, "Kike Becerra"
> <qbecerra@y...> wrote:
> > > Hi again Manuel
> > > I got your reply, and well...
> > >
> > > When user clicks "modify record" the form shows
> again, with the linked
> > > selects, all right, but well, I want to assign a
> predetermined value
> > > to the select, but the VALUE property it is
> already assigned with this
> > > code, which fills the select
> > >
> > > "VALUE"=>Key($paises),
> > >
> > > And I'd like to:
> > > 1- Fill each select
> > > 2- And after 1) assign a value (from its list)
> to each select
> > >
> > > "VALUE"=>$value_user_has_in_its_record;
> > >
> > > Hope you've understood my idea...
> > >
> > > Thanks a lot for helping
> > >
> > >
> > > --- In forms-dev@yahoogroups.com, Manuel Lemos
> <mlemos@a...> wrote:
> > > > Hello,
> > > >
> > > > on 08/30/2005 09:38 PM Kike Becerra said the
> following:
> > > > > Hi again
> > > > > I've 3 operations in my clients db:
> > > > > - Add
> > > > > - Modify
> > > > > - Delete
> > > > >
> > > > > If user chooses ADD, i generate the form
> with the linked selects.
> > > > > User chooses country=EEUU then (after 2nd
> select fills) he chooses
> > > > > state=Chicago and then presses add button,
> and info is stored
> in db.
> > > > >
> > > > > If user chooses MODIFY, then I must generate
> another form,
> with the
> > > > > difference that fields should not be blank,
> but filled with data
> > from
> > > > > the record that must be modified
> > > > >
> > > > > So, if user originally choosed country=EEUU
> & state=Chicago, how
> > could
> > > > > I do for having this automatically set in
> the 2 linked selects ?
> > > > > I mean: instead of seeing
> > > > > Country: -= SELECT A COUNTRY =-
> > > > > State: -= SELECT A STATE =-
> > > > >
> > > > > I should have
> > > > > Country: EEUU
> > > > > State: CHICAGO
> > > > >
> > > > > and these 2 fields should be also linked...
> like the form for
> > adding a
> > > > > new record...
> > > >
> > > > You just need to set the VALUE property of
> each select. Each linked
> > > > select input will pick the initial group from
> the VALUE of its
> > > predecessor.
> > > >
> > > > --
> > > >
> > > > Regards,
> > > > Manuel Lemos
> > > >
> > > > PHP Classes - Free ready to use OOP components
> written in PHP
> > > > http://www.phpclasses.org/
> > > >
> > > > PHP Reviews - Reviews of PHP books and other
> products
> > > > http://www.phpclasses.org/reviews/
> > > >
> > > > Metastorage - Data object relational mapping
> layer generator
> > > > http://www.meta-language.net/metastorage.html
>
>
>
>





______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/

#207 From: Manuel Lemos <mlemos@...>
Date: Wed Sep 7, 2005 6:18 pm
Subject: Re: Re: Linked Selects -> Modify input data
mallemos
Send Email Send Email
 
Hello,

on 09/05/2005 12:26 PM Kike Becerra said the following:
> I've the 2 linked selects...
> When I modify a record, I set the value of the 1º select and it works,
> but when I try to assign a value to the 2º select, it doesn't work...
>
> What's wrong ?
> Here i post the code for the 2º select...
> When I see the form, the 1º select is with the corresponding option
> selected, but the 2º select is with the 1º option..
>
> $form->AddInput(array(
>  "TYPE"=>"custom",
>  "ID"=>"campoprovincia",
>  "NAME"=>"campoprovincia",
>  "LABEL"=>"Localidad: ",
>  "CustomClass"=>"form_linked_select_class",
>  "VALUE"=>$camponombreloc,
>  "SIZE"=>1,
>  "Groups"=>$provin,
>  "LinkedInput"=>"campopais",
>  "ValidateAsNotEmpty"=>1,
>  "ValidationErrorMessage"=>"Seleccione una localidad"
> ));

The VALUE property must be one of the values of the group that is
currently selected by the campopais field.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#208 From: Manuel Lemos <mlemos@...>
Date: Wed Sep 7, 2005 6:19 pm
Subject: Re: Four Level Linked Select Boxes Inconsistent Behavior
mallemos
Send Email Send Email
 
Hello,

on 09/07/2005 02:58 PM operationsengineer1@... said the following:
> i've set up 4 linked selects.  however, i've run into
> an issue you may be able to help with.  when i select
> the first select, the second select auto populates
> with values.  this is also true of the second and
> third selects, respectively.
>
> when i select from the third select, though, the
> fourth select does not auto populate.
>
> when i click on the third select's update button,
> though, it populates the fourth select box.
>
> is this something i'm doing or could this be something
> in the forms class that results in this inconsistent
> behavior when a four level linked select is used?

The currently selected VALUE of the third select must be of of the
groups of the forth select.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

#209 From: <operationsengineer1@...>
Date: Wed Sep 7, 2005 6:26 pm
Subject: Linked Selects and Multiple Select Capability for Last Linked Select
operationsen...
Send Email Send Email
 
Manuel,

is there a way to make multiple choices in the last
linked select (using either ctl or shift keys)?

my application is to allow reworkers to enter the
defects they've just completed reworking.  let's say
there were 3 defects that were reworked.

the reworker would choose product->serial
number->inspection->defect and repeat this three
times.

is there a way to highlight all three defects so the
reworker could enter the data a single time?

i tried including...

'SELECTED'=> array(),

but it didn't enable multiple selects within a select
box.

tia...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#210 From: <operationsengineer1@...>
Date: Wed Sep 7, 2005 6:39 pm
Subject: Re: Four Level Linked Select Boxes Inconsistent Behavior
operationsen...
Send Email Send Email
 
> The currently selected VALUE of the third select
> must be of of the
> groups of the forth select.
>

hi Manuel, i'm not comprehending exactly what you are
communicating.

my third select's value and group look like...

'VALUE'=>$first_inspect_id,
'Groups'=>$inspect,

my fourth select's value and group look like...

'VALUE'=>$first_defect_id,
'Groups'=>$defect,

do i need to change anything in the above code?

if not, i think you must be referencing the arrays
that fill the value/group variables above.

each array level holds 8 values.  when i click on the
update button associated with the third select then
everything works as expected with the fourth select -
so i think the arrays are correctly "linked."

the only missing feature is the 4th selects auto
update when the third select has a value selected.

tia for your help.




______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/

Messages 181 - 210 of 946   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help