?
Solved

Carriage returns in Web Form

Posted on 2006-11-06
7
Medium Priority
?
197 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
5 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
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:
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

850 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