?
Solved

Carriage returns in Web Form

Posted on 2006-11-06
7
Medium Priority
?
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

752 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