/    Sign up×
Community /Pin to ProfileBookmark

Dealing with forms controls!!!

in asp.net i could manage all forms controls in the .net code, like the visibilty and enabling the controls

[COLOR=Navy]<script runat=”server”>
TextBox1.Visible = false;
</script>[/COLOR]

[COLOR=DarkRed]<asp:TextBox ID=”TextBox1″ runat=”server” />[/COLOR]

is there a similar way in PHP or only way is to do that with JavaScript?!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@chazzyNov 11.2005 — php uses html for input only. it doesn't have it's own elements like asp.net does.

maybe if you show us what you're trying to do we can help you figure it out in PHP.
Copy linkTweet thisAlerts:
@NogDogNov 11.2005 — You can do any of that using normal HTML and/or CSS, with the added advantage that it will be more cross-browser compatible.
[code=php]
# assume $disable_flag is TRUE if element is to be disabled, else FALSE
$disable = ($disable_flag) ? "disabled='disabled'" : "";
echo "<input type='text' name='input1' $disable />";
# assume $visible_flag is TRUE if element is to be displayed, else FALSE
$visible = ($visible_flag) ? "" : "style='display: none'";
echo "<input type='text' name='input2' $visible />";
[/code]
×

Success!

Help @Cipher spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...