Solved

Carriage returns in Web Form

Posted on 2006-11-06
7
185 Views
Last Modified: 2010-04-06
Hi

I have a horrible feeling the answer to this is that is not possible but anyway here goes.   I have learnt today that <form> and </form> have "hidden" carriage returns in them.

I can remove the carriage return in the closing tag by inserting style="display: inline;" in the opening tag as in

<form style="display: inline;" id="friendform">

But is there a way of removing the carriage return from the opening form tag?

Thanks.

purpleperson
0
Comment
Question by:purpleski
  • 3
  • 2
7 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
???
I see no breaks:
hello <form style="display: inline;" id="friendform">there
<input type="text" value="friends">
</form>and family
0
 

Author Comment

by:purpleski
Comment Utility
Thanks mplugjan

You are right with your example but with my form I get a carriage return see.

http://www.purpleski.com/friend.aspx

The html in the above is

<body>
  ff<form style="display: inline;" id="friendform" runat="server"><%=SendToFriend.StandardSendToFriendLink(Me)%> </form>PP hello <form style="display: inline;" id="friendform">there <input type="text" value="friends">
</form>and family
</body>

And the <%=SendToFriend.StandardSendToFriendLink(Me)%>  uses this code


  Public Function StandardSendToFriendLink(ByVal WhereFrom As Page) As String
    Dim t As String = ""

    t = t & "<a onclick=""javascript:window.open('{0}','Mailer','status=no,scrollbars=no,resizable=no,width=370,height=445')"" "
    t = t & "href=""{0}"" target=""Mailer""><img src=""{1}"" width=""150"" height=""18"" border=""0"" alt=""email to a friend"" /></a>"

    Dim baseUri As UriBuilder = New UriBuilder(PurpleWeb.BaseHref)
    baseUri.Path = "/images/buttons/emailtoafriend.gif"
    baseUri.Query = String.Empty

    Return String.Format(t, SendToFriendTargetOnly(WhereFrom), baseUri.ToString())
  End Function

Is there something I am missing?

0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 125 total points
Comment Utility
The div around the hidden field is the code that gives the break.

Not sure I understand the reasoning behind the code anyway.
Seems you use a link and not a form so you can drop the form completely, no?

I would by the way do this instead
t = t & "<a onclick=""var w=window.open(this.href,'Mailer','status=no,scrollbars=no,resizable=no,width=370,height=445'); return (w)?false:true"" "
t = t & "href=""{0}"" target=""Mailer""><img src=""{1}"" width=""150"" height=""18"" border=""0"" alt=""email to a friend"" /></a>"


to handle popup blockers
0
 

Author Comment

by:purpleski
Comment Utility
Solved now as I don't need the <form> tags.

Thanks anyway
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
As suggested : "seems you use a link and not a form so you can drop the form completely, no?"

:)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now