Re: Question: Repopulating form parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 12 December 2004 19:32, Stuart Felenstein wrote:

> > Did you mockup some test HTML in a wysisyg editor as
> > suggested?
>
> Yep like this :
>
> <select name="select" size="10" multiple>
>         <option value="1" <?php if (!(strcmp(1,
> "None"))) {echo "SELECTED";} ?>>Black</option>

Um, your HTML wysiwyg editor can insert PHP code for you? The object of the 
exercise is to see what properly constructed HTML for displaying "multiselect 
dropdown boxes with pre-selected values" look like so you can try and 
reproduce it using PHP. If the above code does that then fine (I don't care 
to check).

> //Attempt, problems with parsing errors:
>
> <select name="Ind[]" size="8" multiple="multiple"
> id="Ind[]" >
> <?php
> while($row = mysql_fetch_array($inds, MYSQL_BOTH)) {
> echo '<option value="'.$row['CareerIDs'].'">';
> if (!(strcmp($row_rsInd['CareerIDs'], '$Ind')));

Why do you always get your IF clauses wrong (look at back at your previous 
posts). There should not be a semi-colon there. Read manual > Language 
Reference (thoroughly, until you can recite it back to front (or 
alternatively learn to refer to it when you get syntax (parsing) errors 
instead of asking the list)).

> Close but no cigar.  Since $Ind is already imploded my
> thinking is it need not be incremented in the echo
> statement ?

You tell me, print_r() and var_dump() it before you use it and decide whether 
it is correct.

One final thing: '$Ind' is not the same as "$Ind".

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Any stone in your boot always migrates against the pressure gradient to
exactly the point of most pressure.
es a  -- Milt Barber
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux