I am using a simple form in modx CMS and I need the textarea to retain the line breaks.
I'd prefer a javascript solution if possible.
This is because the textarea will be used to order food and the client doesn't want to receive a single line of text.
eg, this entry:
1 can coke
3 beef sandwiches
1 cake
is received as:
1 can coke 3 beef sandwiches 1 cake
===
html code here ..
===
Many thanks!
Steve
I'd prefer a javascript solution if possible.
This is because the textarea will be used to order food and the client doesn't want to receive a single line of text.
eg, this entry:
1 can coke
3 beef sandwiches
1 cake
is received as:
1 can coke 3 beef sandwiches 1 cake
===
html code here ..
Code:
<form class="orderform" method="post" action="[~[*id*]~]"> <input type="hidden" name="formid" value="eCafeForm" /> <fieldset class="fieldset1"> <ol> <h3>Your contact details</h3> <li><label for="firstname">First Name:</label> <input type="text" name="firstname" maxlength="60" eform="Your Name:firstname:1"></li> <li><label for="lastname">Last Name:</label> <input type="text" name="lastname" maxlength="60" eform="Your Name:lastname"></li> <li><label for="telephone">Telephone:</label> <input type="text" name="telephone" size="40" maxlength="40" eform="Your Telephone:telephone:1"></li> <li><label for="email">Email:</label> <input type="text" name="email" size="40" maxlength="40" eform="Your Email:email:1"></li> <li><label for="department">Department:</label> <input type="text" name="department" size="40" maxlength="40" eform="department"></li> <li><label for="order">Your order</label> <textarea cols="40" rows="6" name="order" eform="Your Order:order"></textarea></li> <!--<li><label for="date">Date required:</label> <input type="text" name="date" size="40" maxlength="40" eform="date"></li> --> <li><label for="time" >Time to be picked up:</label> <select class="time" name="time"> <optgroup> <option value="choose time" >Choose time ..</option> <option value="11am - 11.30am" >11am - 11.30am</option> <option value="11.30am - 12 noon" >11.30am - 12 noon</option> <option value="12 noon - 12.30pm" >12 noon - 12.30pm</option> <option value="12.30pm - 1pm" >12.30pm - 1pm</option> <option value="1pm - 1.30pm<" >1pm - 1.30pm</option> <option value="1.30pm - 2pm<" >1.30pm - 2pm</option> </optgroup> </select> </li> <li><input class="btn" type="submit" name="submit" value="Place Order"/></li> </ol> </fieldset> </form>
Many thanks!
Steve
Comment