You are here: Re: How to retrieve the text of a drop down list after a POST? « PHP Programming Language « IT news, forums, messages
Re: How to retrieve the text of a drop down list after a POST?

Posted by rlee0001 on 03/26/06 08:03

Denis,

David's code with work for the H:Hello syntax you posted before.

But be aware that the user can manipulate both strings so you shouldn't
trust anything you pass via POST. The best way is to do a query on the
destination page. It may seem redundant but it is the least error prone
and compared to parsing apart strings it should be easier to manage as
well if you change things later.

Is client-side JS acceptable? If so put the full string in the
'longvalue' attribute of the option tags. Then on form_onsubmit copy
that attribute's value to a seperate hidden form input element. Use
hiddenfield.value =
getElementById('myselect').getAttribute('longvalue') or something like
that (untested).

-Robert

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация