Advanced Web Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignAdvanced Web Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 7th, 2005, 04:16 PM
SLATE SLATE is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 6 SLATE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 11 sec
Reputation Power: 0
XHTML input value cannot contain tags?

I have a validation issue with a site I'm working on converting from html to xhtml 1.0.

<input name="music" type="text" size="35" class="textfield" value="rage against the machine&nbsp;&nbsp;&nbsp;<a href='link.php?linkID=17' title='amazon.com' target='_blank'>[Amazon.com]</a>" />

It gives me these 2 lovely errors:

1) character "<" is the first character of a delimiter but occurred as data

...against the machine&nbsp;&nbsp;&nbsp;<a href='link.php?linkID=17' title='amaz

If you wish to include the "<" character in your output, you should escape it as "<". Another possibility is that you forgot to close quotes in a previous tag.

2) character "<" is the first character of a delimiter but occurred as data

...zon.com' target='_blank'>[Amazon.com]</a>" />

if these are changed into &lt's and gt's they won't work when they are pulled from the db and rendered to the client. It'l just show up as the tag, not as a link.

Any ideas on how to get around this?

Reply With Quote
  #2  
Old July 8th, 2005, 09:05 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
In order for your input tag to validate, you will need to replace the < and > characters with their HTML entities.
Code:
<input name="music" type="text" size="35" class="textfield" value="rage against the machine&nbsp;&nbsp;&nbsp;<a href='link.php?linkID=17' title='amazon.com' target='_blank'>[Amazon.com]</a>" />


Perhaps keep it stored in the database the way you have it, with < and >...
Write a function to convert those characters to < and >
Perhaps regular expressions will help.

Reply With Quote
  #3  
Old July 9th, 2005, 02:07 PM
SLATE SLATE is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 6 SLATE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 11 sec
Reputation Power: 0
Yeah thats what I ended up doing. Unfortunately, this seems to be the only real possible 'fix'.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignAdvanced Web Development > XHTML input value cannot contain tags?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT