Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 3rd, 2004, 03:27 PM
Registered User
 
Join Date: Nov 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to MooMan65 Send a message via AIM to MooMan65
Default Disabling Form Fields

Hey everyone, I'm currently modding a forum that requires information to be submitted in order to create a new character. However what I want is that after someone has created a character they cannot change some of the values. Now for example where you enter in your character name I use if conditionals to determine if they are creating a character or editing one:

Code:
<if condition="$member[name]==''>
<input type='text' name='name' value='{$member[name]}' size="25" maxlength="30" class='bginput'>
<else />
<input type='text' name='name' value='{$member[name]}' size="25" maxlength="30" class='bginput'>
</if>
What I want to do is ask if there is some way I can adjust the code in bold to make it so that input field is read only (like in any program when something is disabled) so people cannot alter the contents inside.

Thanks.

 
Old November 3rd, 2004, 06:02 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

You could look at using the DISABLED or READONLY attributes of the INPUT tag. ALternatively you could add a Javascript event such as ONFOCUS=BLUR(); or you could just display the field as plain text with no Form elements.
 
Old November 3rd, 2004, 07:09 PM
Registered User
 
Join Date: Nov 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to MooMan65 Send a message via AIM to MooMan65
Default

Ahh thanks! Does that work like:

Code:
<input attribute="readonly" type="text"...>
or

Code:
<input readonly type="text"...>
 
Old November 4th, 2004, 07:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

see http://www.htmlcodetutorial.com/form..._DISABLED.html





Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Fields Terry J Daichendt JSP Basics 2 September 15th, 2008 05:53 PM
Multiple Form Fields tripster General .NET 2 October 17th, 2007 04:22 AM
copy fields from Form to new form - openargs justabeginner Access VBA 1 February 4th, 2007 01:28 PM
Enabling/Disabling Form Controls lbyii Javascript 6 October 13th, 2006 07:36 AM
Enabling and Disabling form elements socoolbrewster Javascript How-To 4 February 21st, 2006 04:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.