Hiding a value

hi how do i hide the (team_id) value in the below form

<option value="' . $row['team_id'] . '' . $row['teams'] . '" ' . $selected . '>' . $row['teams'] . '</option>


undo your concatenation.


Hide in what way - not be able to see it if you use “view source”?

hide as in the code shows result like this

4 Chelsea Chelsea

i want the 4 to hide but still be able to be submitted.

Hide just visually when viewing the page, or hide within the source code too?

hide when visually viewing the page

If it is in the value attribute, it will not be visible on the page, but will still be visible in the source code.
What is between the option tags is what is visible on the page, but it is the value that is submitted.

they are all visible

4 Chelsea they both get submitted just tot if theres a way the 4 doesnt display while viewiing the page

The code you showed above should not display the ‘4’, but will submit it. Can you show the values of the two variables $row['team_id'] and $row['teams'], and (if it’s done that way) the code that generates the options?

I don’t know your database, but I can’t see the point of having both the team_id field and the team name in the value that you submit - surely just the ID would be sufficient, otherwise it’s not really suitable to be called an id.

thats the full code

// team 1
        $query = "SELECT team_id, team_image, teams FROM " . $DBPrefix . "sports";
        $db->query($query, $params);
        $TPL_team1_list = '<select name="team1">' . "\n";
        while ($row = $db->fetch())
            $selected = ($row['teams'] == $team1) ? 'selected="true"' : '';
            $TPL_team1_list .= "\t" . '<option value="' . $row['team_id'] . '' . $row['teams'] . '" ' . $selected . '>' . $row['teams'] . '</option>' . "\n";
        $TPL_team1_list .= '</select>' . "\n";

the team_id is what get submitted which is the 4
the first teams shows form page
the second team shows in the confirm page along side the team_id, thats why was wondering how not to display it make it (hidden)

Well, then we need to see the code for the confirm page, not the code for the initial selection list. The code here won’t show the team id unless the user hits ‘view source’, or it’s also in the teams column.

oh okay but nothing much to show this the part of the template that shows the imp value

//second display
                    'ERROR' => ($ERR == 'ERR_') ? '' : $ERR,
                    'PAGE' => 2,

                    'AUC_TEAM1' => $team1,
                    'AUC_TEAM2' => $team2,

Ah, sorry, I can’t help with that, I have no knowledge of template-based systems.

ok thanks

@skyhighweb it might help others to help you if you said what template system you are using…

am using tpl as a template connected to php

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.