line return "within" text area

I’m needing a line return “within” the value of a text area

 <textarea name="text">line 1 <br>line 2 <br>line3</textarea>

however
or
does not make the line return

What should I use?

David


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

An actual line-break. Inside the value of a textarea, line-breaks are
honored and displayed.

Walter

On May 28, 2010, at 8:42 AM, David Owen wrote:

I’m needing a line return “within” the value of a text area

<textarea name="text">line 1 <br>line 2 <br>line3</textarea>

however
or
does not make the line return

What should I use?

David


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Are you sure? A normal line-break does not work. Freeway strips them out making one line it just copied and pated into the value section when published

Or in this instance I’m posting the details from another page to appear in the text area with php

David

On 28 May 2010, at 14:11, Walter Lee Davis wrote:

An actual line-break. Inside the value of a textarea, line-breaks are honored and displayed.

Walter

On May 28, 2010, at 8:42 AM, David Owen wrote:

I’m needing a line return “within” the value of a text area

line 1
line 2
line3

however
or
does not make the line return

What should I use?

David


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’m positive.

This code (written in Textmate):

<textarea name="foo" rows="8" cols="40">this is a test
	this is more of the
	test
</textarea>

makes this image in Safari:

textarea screenshot

Now whether Freeway will let you enter that code directly, or whether Freeway adds an attribute to the textarea like wrap=“virtual” or something like that is something to explore.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

mmm… I’m using the Form element styler action on the text area. I don’t think that is the problem.

Text is copied from TextEdit or TextWranger and the carriage returns are not taking at all.

Select the first product here: Single Ply Restaurant Order Pads

To take you to the order form and see no line returns are holding on the right column forms.

Or here for just a text area: http://www.printlineadvertising.co.uk/demo/rostrons/test.html

David

On 28 May 2010, at 14:33, waltd wrote:

I’m positive.

This code (written in Textmate):

<textarea name="foo" rows="8" cols="40">this is a test
	this is more of the
	test
</textarea>

makes this image in Safari:

textarea screenshot

Now whether Freeway will let you enter that code directly, or whether Freeway adds an attribute to the textarea like wrap=“virtual” or something like that is something to explore.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Looking at your source code, the line breaks that you entered in
Freeway appear to be stripped out during publishing. This would seem
to me to be a bug. The textarea is coded nearly identically to mine,
but because those linebreaks are not in the published source, there
are no linebreaks shown in the browser.

If you are generating this content programmatically, then you don’t
have to worry – just make sure your code emits a proper linebreak
(n) and you should be fine.

Walter

On May 28, 2010, at 10:05 AM, David Owen wrote:

mmm… I’m using the Form element styler action on the text area. I
don’t think that is the problem.

Text is copied from TextEdit or TextWranger and the carriage returns
are not taking at all.

Select the first product here: Single Ply Restaurant Order Pads

To take you to the order form and see no line returns are holding on
the right column forms.

Or here for just a text area: http://www.printlineadvertising.co.uk/demo/rostrons/test.html

David

On 28 May 2010, at 14:33, waltd wrote:

I’m positive.

This code (written in Textmate):

<textarea name="foo" rows="8" cols="40">this is a test
	this is more of the
	test
</textarea>

makes this image in Safari:

textarea screenshot

Now whether Freeway will let you enter that code directly, or
whether Freeway adds an attribute to the textarea like
wrap=“virtual” or something like that is something to explore.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walt,

What is the correct character/s for a line break in a text area? nothing seems to work at this end

Bearing in mind the output is generated in php depending on the values sent to that page and the php code at the moment is entered in the text area > value of the Freeway interface (which might be my whole problem).

kind regards

David

On 28 May 2010, at 15:35, Walter Lee Davis wrote:

just make sure your code emits a proper linebreak (n) and you should be fine.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If I make an include into the Freeway textarea value instead, then it works. OK.

Its a Freeway bug.

David

On 28 May 2010, at 15:35, Walter Lee Davis wrote:

just make sure your code emits a proper linebreak (n) and you should be fine.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There’s actually no way to type a line break in the interface itself - I’ll get it logged.

Joe

On 28 May 2010, at 16:04, David Owen wrote:

If I make an include into the Freeway textarea value instead, then it works. OK.

Its a Freeway bug.

David

On 28 May 2010, at 15:35, Walter Lee Davis wrote:

just make sure your code emits a proper linebreak (n) and you should be fine.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

In PHP and other C-like languages, the standard escape string for a
newline is backslash-n.

n

(That may not format correctly in the Web, but it does in Mail.) You
may also use a regular newline in your code, so that the variable
value spans multiple lines.

$var = 'this is some
multi-line text
that spans a few
lines.';

If you are saving text in the database, be sure to use a binary blob
column type like TEXT, and then these control characters will be saved
correctly (escaped and unescaped when written and read back from the
database). If you save the value in a VARCHAR or a CHAR column, then
the newline characters will either be stripped out, or the string will
terminate after the first linebreak, depending on the specific version
of MySQL you are using. (I think that’s the determining factor here.)

Walter

On May 28, 2010, at 10:52 AM, David Owen wrote:

Hi Walt,

What is the correct character/s for a line break in a text area?
nothing seems to work at this end

Bearing in mind the output is generated in php depending on the
values sent to that page and the php code at the moment is entered
in the text area > value of the Freeway interface (which might be my
whole problem).

kind regards

David

On 28 May 2010, at 15:35, Walter Lee Davis wrote:

just make sure your code emits a proper linebreak (n) and you
should be fine.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

One thing I left out of this: if you are writing some code in PHP that
you want to include a newline, and you don’t want to just quote a
multi-line string, then the type of quotation marks you use matters a
lot.

print 'onentwonthree'; // =>  onentwonthree
print "onentwonthree"; // => one
two
three

The reason for this is that single-quotes are not evaluated for any
sort of substitution. And that’s good, because if you are just quoting
a plain string, you don’t need the overhead of PHP dipping into
evaluation mode, looking for variables and function invocations to
process, you just want to output that text. Double-quotes indicate to
PHP (and other C-like languages – Ruby for example) that the contents
of the string might need some preprocessing.

Walter

On May 28, 2010, at 11:33 AM, Walter Lee Davis wrote:

In PHP and other C-like languages, the standard escape string for a
newline is backslash-n.

n


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Saying that ~ it now started work correctly by re-opening the Freeway document.

David

On 28 May 2010, at 16:13, Joe Billings wrote:

There’s actually no way to type a line break in the interface itself - I’ll get it logged.

Joe

On 28 May 2010, at 16:04, David Owen wrote:

If I make an include into the Freeway textarea value instead, then it works. OK.

Its a Freeway bug.

David

On 28 May 2010, at 15:35, Walter Lee Davis wrote:

just make sure your code emits a proper linebreak (n) and you should be fine.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter,

Now that the form is working as planned, if I wanted to take it to another level, whats involved to be able add/post a second value from the product pages:

http://www.printlineadvertising.co.uk/demo/rostrons/order-form.php

To the order form ~ below the existing value in the text area:

I’m going to have to store the product title, qty, and price when going to and fro and growing the order? are we talking cookies, and how?

David

On 28 May 2010, at 16:48, David Owen wrote:

Saying that ~ it now started work correctly by re-opening the Freeway document.

David

On 28 May 2010, at 16:13, Joe Billings wrote:

There’s actually no way to type a line break in the interface itself - I’ll get it logged.

Joe

On 28 May 2010, at 16:04, David Owen wrote:

If I make an include into the Freeway textarea value instead, then it works. OK.

Its a Freeway bug.

David

On 28 May 2010, at 15:35, Walter Lee Davis wrote:

just make sure your code emits a proper linebreak (n) and you should be fine.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That’s would be create a session,add the 3 three pieces of data as a string, then move from page to page, adding further 3 pieces of data onto the end of that string to create a longer string?

Will have a play and see what I can come up with.

David

On 28 May 2010, at 16:57, David Owen wrote:

if I wanted to take it to another level,


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

A session can carry an array, too, so you don’t have to keep encoding
and decoding to a string. The session itself is an associative array
object, with as many different key/value pairs as you might want to
carry around. Example:

//write the values
session_start();
$_SESSION['foo'] = $foo;
$_SESSION['bar'] = $bar;
$_SESSION['baz'] = array('baz','blah');

//read them back on another page
session_start();
$foo = ($_SESSION['foo']) || '';
$bar = ($_SESSION['bar']) || '';
$baz = ($_SESSION['baz']) || '';

Unlike a cookie, sessions can store a large amount of data. The data
is saved to a file on disk on your server. If you do this, be aware
that on a shared server, unless you have moved the default session
store location through a configuration file update into a location you
control, other users of the same server have the necessary permissions
to snoop through these files, which will also be in a known location.
That said, if you serialize the data before saving it, you can stash
an entire Object in the session, and share it around pages that way:

//trivial example, not secure
$current_user = ActiveRecord::FindFirst('users','login = "' . $login .  
'"');
session_start();
$_SESSION['current_user'] = serialize($current_user);


//on another page
session_start();
$current_user = unserialize($_SESSION['current_user']);

// $current_user is now an exact replica of the object created on the  
first page,
// and you don't have to look it up in the database again.

Walter

On May 28, 2010, at 12:36 PM, David Owen wrote:

That’s would be create a session,add the 3 three pieces of data as a
string, then move from page to page, adding further 3 pieces of data
onto the end of that string to create a longer string?

Will have a play and see what I can come up with.

David

On 28 May 2010, at 16:57, David Owen wrote:

if I wanted to take it to another level,


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Arrays always start bending my brain. So I can understand…

By posting from the cart to the order from will add fields to the session data.

Going back to the cart and selecting another product will “add” to the session data and post “all” session data contents into the order again

etc. etc.

Its the “adding” to existing data I can’t get my head around.

David

On 28 May 2010, at 18:04, Walter Lee Davis wrote:

A session can carry an array, too, so you don’t have to keep encoding and decoding to a string. The session itself is an associative array object, with as many different key/value pairs as you might want to carry around. Example:

//write the values
session_start();
$_SESSION['foo'] = $foo;
$_SESSION['bar'] = $bar;
$_SESSION['baz'] = array('baz','blah');

//read them back on another page
session_start();
$foo = ($_SESSION['foo']) || '';
$bar = ($_SESSION['bar']) || '';
$baz = ($_SESSION['baz']) || '';

Unlike a cookie, sessions can store a large amount of data. The data is saved to a file on disk on your server. If you do this, be aware that on a shared server, unless you have moved the default session store location through a configuration file update into a location you control, other users of the same server have the necessary permissions to snoop through these files, which will also be in a known location. That said, if you serialize the data before saving it, you can stash an entire Object in the session, and share it around pages that way:

//trivial example, not secure
$current_user = ActiveRecord::FindFirst('users','login = "' . $login . '"');
session_start();
$_SESSION['current_user'] = serialize($current_user);


//on another page
session_start();
$current_user = unserialize($_SESSION['current_user']);

// $current_user is now an exact replica of the object created on the first page,
// and you don't have to look it up in the database again.

Walter

On May 28, 2010, at 12:36 PM, David Owen wrote:

That’s would be create a session,add the 3 three pieces of data as a string, then move from page to page, adding further 3 pieces of data onto the end of that string to create a longer string?

Will have a play and see what I can come up with.

David

On 28 May 2010, at 16:57, David Owen wrote:

if I wanted to take it to another level,


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, nothing will get added to your session without you doing it directly. That’s a security feature, and you wouldn’t want to undo it by turning on register_globals, either.

If you want to maintain a list of products that the customer has ordered (as a cart?) then you would need to intercept each form submission and iterate over its member elements, updating the session array to match. Only once, at the end of the order process, would you read out that array and submit it for payment.

Having read back what I just wrote, and what you asked, I’m not sure if I’ve answered anything for you, or even what it is you want to do here. Can you tell a little user story about how someone would interact with this application?

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yep, Its built with WebYep for the product side. Its mainly used by “account” holders, it’s purely and order form (email copy to user and client and last stage). No monies involved.

And it will be mainly for a single item ordered (I’ve ticked all boxes “as is”). However there are rare occasions where two, maybe three item are ordered.

So I’m just exploring what is possible without sending the data out to say mal’s ecom (which just involves more user clicks to complete the order ~ and takes them aways from the site).

Keeping this simple is the key here.

David

On 28 May 2010, at 18:58, waltd wrote:

Can you tell a little user story about how someone would interact with this application?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Can you post a mockup of the form you’re trying to wire to the
session? That would go a long way toward helping you out. If you’re
using checkboxes or radio buttons, or individual submit buttons – it
means a different handler approach on the back-end.

Walter

On May 28, 2010, at 2:25 PM, David Owen wrote:

Yep, Its built with WebYep for the product side. Its mainly used by
“account” holders, it’s purely and order form (email copy to user
and client and last stage). No monies involved.

And it will be mainly for a single item ordered (I’ve ticked all
boxes “as is”). However there are rare occasions where two, maybe
three item are ordered.

So I’m just exploring what is possible without sending the data out
to say mal’s ecom (which just involves more user clicks to complete
the order ~ and takes them aways from the site).

Keeping this simple is the key here.

David

On 28 May 2010, at 18:58, waltd wrote:

Can you tell a little user story about how someone would interact
with this application?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I have not got round to doing anything on the session code yet, just exploring what is possible (I’ll try and take a look this weekend)

The (looped) forms originally creating the data are here:

They take customer CMS data out of WebYep with PHP using some API tricks.

<form action="order-form.php" method=post>
<p class="body">Please supply <input name="qty" value="1" size=3 maxlength=5> (number) of packs</p>
		<p class="body"><input type=submit name="button" value="Order Now"></p>
<input type=hidden name="id" value="012 Order Pads">
<input type=hidden name="price" value="47.95">
</form></p>

Then plonks a string into the Order Form text area:

http://www.printlineadvertising.co.uk/demo/rostrons/order-form.php

<?php
$id= $_POST['id'];
$qty= $_POST['qty'];
$price= $_POST['price'];
?>


<?
if ($price != "")
echo "( $qty ) pack/s of:
$id
@ &#163; $price per pack
----------------------------------"
?>

David

On 28 May 2010, at 19:30, Walter Lee Davis wrote:

Can you post a mockup of the form you’re trying to wire to the session?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options