Solved

Carriage returns in Web Form

Posted on 2006-11-06
7
187 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
ID: 17879822
???
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
ID: 17880001
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
ID: 17880348
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
ID: 17880429
Solved now as I don't need the <form> tags.

Thanks anyway
0
 
LVL 75

Expert Comment

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

:)
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

777 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