[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Carriage returns in Web Form

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

649 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