Textarea to auto line break

Hi,
I have a page where I have placed a <TEXTAREA>.
Currently I have a <BR> tag making a new line.
But I would like it to make a new line when I press enter.

.oO(The_FedEx_Guy)
> I have a page where I have placed a <TEXTAREA>.
Currently I have a <BR> tag
>making a new line.
>
> But I would like it to make a new line when I press
enter.
Problem solved, but there's another thing. Given the code
below, you
should definitely have a look at arrays and more efficient
if-
conditions.
> <?php
> $radio = "unchecked";
> $radio2 = "unchecked";
> $radio3 = "unchecked";
> $radio4 = "unchecked";
> $radio5 = "unchecked";
> $radio6 = "unchecked";
> $radio7 = "unchecked";
> $radio8 = "unchecked";
> $radio9 = "unchecked";
> $radio10 = "unchecked";
Shorter:
$radio = array_fill(1, 10, 'unchecked');
Might require modifications in other parts of the code,
though.
> if ($_POST['radio'] == "1") {
> $image = "businesscard/sm_card_1.jpg";
> }
> else if ($_POST['radio'] == "2") {
> $image = "businesscard/sm_card_2.jpg";
> }
> else if ($_POST['radio'] == "3") {
> $image = "businesscard/sm_card_3.jpg";
> }
> [...]
Shorter, even with additional sanity checks:
if (isset($_POST['radio']) &&
is_numeric($_POST['radio']) &&
$_POST['radio'] >= 1 && $_POST['radio'] <= 10)
$card = intval($_POST['radio']);
$image = "businesscard/sm_card_$card.jpg"
If these both snippets are somewhat associated, you could
even use the
array created above for the sanity check:
if (isset($_POST['radio']) &&
isset($radio[$_POST['radio']])) {
$image = "businesscard/sm_card_{$_POST['radio']}.jpg"
HTH
Micha

Similar Messages

  • Auto line breaks in ipad numbers

    QUESTION: IN IPAD 4 APPLICATION NUMBERS , CELLS, HOW TO  SET THE AUTO LINE BREAK (SETTING THE THE DEFAULT VALUE OF THE ENTER KEY TO "NEXT LINE" INSTEAD OF "NEXT CELL" IN ORDER TO GET A TEXT LENGTH DEPENDANT CELL HEIGHT ?

    Not the help you were looking for, but that is the way Numbers is designed currently. It does not work in landscape mode on the iPhone for some reason. LEt's hope they fix this in the next revision. Out of all the apps that could make use landscape mode on the iPhone, Numbers has to be at the top of that list. Drives me nuts evey time I try to use it on my phone.

  • HT4642 ios numbers:how to make cell height variable with auto line brake setting ?

    ipad numbers; How to make cell height variable with auto line break setting?

    That's strange. I responded earlier and the whole message got trashed. Hence the test post before retyping the entire thing again.
    Thanks for the reply.
    The video clip is a single screen capture video clip. This is what I've found by playing around with this more.
    The original clip resolution is greater than 640x480. If I use QT Pro to convert the original clip to 640x480 and then use either Flip4Mac or PE7, then the resolution looks good.
    Just trying to figure out if should keep all workflow on the MacOS side. There are several different version of Flip4Mac. $49 gives me 640x480, but if I ever want to make it slightly larger then I would need to go with the $99 or HD version.
    I also tried to export to AVI with QT Pro and the import with Windows MovieMaker but it didn't work really good. I liked the simplicity (since PE7 hogs a lot of resources especially through VMWare).

  • Read Only TextAreas with Carriage Return, Line Breaks and Word Wrapping

    Hi all,
    I know there are a few posts around this subject but I cannot find the answer to the exact problem I have.
    I have a page that has a 'TextArea with Character Counter' (4000 Chars) that is conditionally read only based on the users credentials (using the 'Read Only' attributes of the TextArea item).
    When the field is editable (not Read Only) everything works fine but when I make the field Read Only I start to have problems:
    The first problem is that the Carriage Return and Line Breaks are ignored and the text becomes one continuos block. I have managed to fix this by adding pre and post element text of pre and /pre tags. This has made the Carriage Return and Line Breaks word nicely and dispaly correctly.
    However, it has introduced a second problem. Long lines, with no Carriage Returns or Line Breaks, now extend to the far right of the page with no word wrapping, making my page potentially 4000+ characters wide.
    How can I get the field to be display only, with recognised Carriage Returns and Line Breaks, and Word Wrapping inside a fixed width of, say, 150 characters?
    Many thanks,
    Martin

    Hi,
    Just a cut and paste of yours with the field name changed:
    htp.p('<script>');
    htp.p('$x("P3_COMMENTS").readonly=true;');
    htp.p('</script>');I also have the following in the page HTML Header, could they be conflicting?
    <script type="text/javascript" language="JavaScript">
    function setReleaseToProd(wpTypeCode){
       //setReleaseToProd($v(this))
      var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=set_release_to_prod',0);
      get.addParam('x01',wpTypeCode);
      gReturn = get.get();
      if(gReturn) {
         $s('P3_RELEASE_TO_PROD',gReturn);
      get = null;
    </script>I am a long way from knowing much about Javascript (this page code was written by someone else) so all help is much appreciated.
    Martin

  • Line Break on Textarea using javascript

    I have a data loading page into a table with a single column of varchar(4000). When the user pastes into the textarea, there are multiple line breaks - but some of the lines are > 4000 and end up being truncated during the load process. What I would like to do is in javascript: 1) find the lines that are longer than 4000 and insert a \n so that two (or more) rows will be loaded rather than truncated.
    http://apex.oracle.com/pls/apex/f?p=80892:1 user: demo pw: demo workspace: SVK

    I was trying to map the line break in a embedded field inside a paragraph. So I guess that is the reason why is not working.
    To make it clear: I'm triggering the paragraphs through a MLT with the ParagraphAssembly rule and a paragraph list.
    Some of these paragraph need to put some data extracted from the XML input just in the middle of the text.
    I have tried the html tags line break &lt;br/&gt; and paragraph &lt;p&gt;, in the middle of the text and also in the field, but is not working, the tags are being shown instead of the line break.
    Any ideas?

  • Unwanted Line Breaks in PL/SQL CODE after 'CREATE OR REPLACE' statements

    Does anybody know how to keep SQL Developer from automatically editing PL/SQL code and adding line breaks after 'CREATE OR REPLACE' statements?
    It keeps taking:
    CREATE OR REPLACE PACKAGE DEVELOPER AUTHID DEFINER
    And turns it into:
    create or replace
    package developer AUTHID DEFINER
    This unwanted linebreak causes our autodeployment processes to break.
    Thanks,
    Michael Dunn
    University of Notre Dame
    Edited by: user9133268 on Feb 21, 2012 8:00 AM

    Hi Michael,
    I believe nothing for this issue has progressed since it was asked here:
    2.1 RC Extra Line Breaks
    As there may be approval for some planned improvements to the SQL Formatter feature in 3.2, I logged an enhancement request for you:
    Bug 13744858 - FORUM: UNWANTED LINE BREAK AFTER CREATE OR REPLACE SYNTAX
    Regards,
    Gary
    SQL Developer Team
    Edited by: Gary Graham on Feb 21, 2012 4:19 PM
    But if you have control over your auto-deployment process code, it might be quicker to enhance that to deal with CREATE OR REPLACE on the same or the preceding line. Also, note that if you edit the package DDL to put the CREATE OR REPLACE on the same line with the package name in the code editor, then immediately use Export or Save Package Spec and Body to save it to disk, then PACKAGE <name> will appear on the same line as the CREATE OR REPLACE syntax.

  • TextArea ignoring new lines

    Hi,
    I am working on old Flex3 (Cairngorm2) app.
    One of TextArea's there is completely ignoring new lines (Carriage Return/Line Feed)
    and even skips some spaces (others work fine).
    Code is pretty simple (well, little simplified here):
    <fx:TextArea  text="myText" selectable=true change=updateText(event)"/>
    private function updateText(evt:Event):void {
      var event:UpdateEvent = new UpdateEvent(UpdateEvent.UPDATE_EVENT);
      event.myText=myText.text;
       trace("myText"+event.myText) //added by me
      event.dispatch();
    I have read about weird behaviors of TextArea (skipping or even doubling some characters) on the net,
    but so far could not find anything applicable in that case.
    For example, something like    myText.text.replace("\n", "\r") doesn't change anything.
    I guess, there is no "\n" there.
    If I trace, it returns line without newlines (like:  'startskip1lineskip2linesend;').
    But if I copy-paste that line to say another TextArea on the screen (or non flex Chat app, I would get multiline text:
    'start
    skip1line
    skip2lines
    end;
    And for various reasons I can't debug that app.
    Any idea what might be wrong and how to fix it?
    Please help!
    TIA,
    Oleg.
    P.S.:  App connects to SPs in the Database via Web Service. No BlazeDS.

    I  haven’t heard of this problem before.  I’d guess there is code running that is removing the line breaks.  I would first check to see if both \r and \n are being removed or not.  Then I’d add a keyDown handler and single step in the debugger through the hundreds of lines of code that run when you hit a key.  My guess is that you’ll end up in code you didn’t expect that is removing the whitespace.

  • How to solve the auto word break problem in Arabic language Flex project

    Hi, I'm using Flex SDK 3.5 to develop a game in Arabic. Now I have a problem with the auto word break on the TextArea Control.
    The output looks like this (Sorry I can't type arabic, so I use English instead)
    I don't know any A
    rabic text
    The expected outpit should be
    I don't know any
    Arabic text
    My settings of the textarea are fine in English version games. But just didn't work in Arabic. Any idea how to solve this problem? Thanks.

    Hi Rodger,
    Sorry to reopen this thread again. I was puzzled by the data format in Motion-DDK.
    From the Motion-DDK, if u32, i32 and f64 data are passed to and from the controller, a specific format must be followed as below:
    u32:
    u32 cmddata[x] = (WORD) (u32data ?16);
    cmddata[x + 1] = (u16) u32data;
    i32:
    i32 cmddata[x] = (WORD) (i32data ?16);
    cmddata[x + 1] = (i16) i32data;
    f64:
    f64—big endian order cmddata[x] = ((u16) (&f64data)) [3];
    cmddata[x + 1] = ((u16) (&f64data)) [2];
    cmddata[x + 2] = ((u16) (&f64data)) [1];
    cmddata[x + 3] = ((u16) (&f64data)) [0];
    f64—little endian order cmddata[x] = ((u16) (&f64data)) [0];
    cmddata[x + 1] = ((u16) (&f64data)) [1];
    cmddata[x + 2] = ((u16) (&f64data)) [2];
    cmddata[x + 3] = ((u16) (&f64data)) [3];
    My first question: is the "?" symbol means the >> (shift operator) or something else?
    The second question is: if "?" means ">>" in this list, all the u32 and i32 data are always transferred in big-endian order. Is it the only correct way to deliver the i32 and u32 data? Or I can pass the u32 and i32 either in little-order or big-order depending on my platform?
    The last one: could you provide a feasible C code on how to convert the f64 data to u16?
    I first followed the format in the list to convert the f64 data, but met with a lot of compiler errors in VC++. After checked with MSDN, it is said the convert process is double(f64)->long(i32)->unsigned short(u16). But the decimal part of double will be truncated during converting to long...
    So, could you help me with some very simple sample code on the convert process? 
    Thank you for your support!
    Rick
    MSP

  • Line breaks in java

    Hi, I'm a little new to Java. I am trying to make a line break that is not in a textbox. So far, to make something similar to a line break, I played with the size of the applet on the HTML file. However, it's not working for one of my applets because it must be in several lines.
    I know that you can use /n or /r/n for line breaks in a TextArea, but I need to use line breaks to separate Buttons and several TextFields.
    In an earlier forum there was something like this:
    System.getProperty("line.separator");
    I don't really know how to add the line separator to my code. I pasted that just inside
    public class ClassName extends java.applet.Applet
    implements ActionListener
    right before
    public void init( )
    I tried putting "line.separator" in a string, but it did not work
    I also tried the following:
    add(/n);
    add(/r/n);
    add(line.separator);
    but none of them worked.
    If someone could help me, I would very much appreciate it. Thanks!

    I don't know why I didn't think of that, but there's an error when I compile it.
    SquareRoot.java:21: cannot find symbol
    symbol : method add(java.lang.String)
    location: class SquareRoot
    add(System.getProperty("line.separator"));
    ^
    And the same thing happens when I try it with \n
    SquareRoot.java:21: cannot find symbol
    symbol : method add(java.lang.String)
    location: class SquareRoot
    add("\n");
    ^
    Here's the code:
    public class SquareRoot extends java.applet.Applet
         implements ActionListener
         TextField m1, m2;
         Button b;
         double i1, i2, i3, i4;
         public void init( )
              m1 = new TextField(20);
              m2 = new TextField(20);
              b = new Button("Calculate");
              add(m1);
              add("\n");  //I'm trying to add a line break here
              add(b);
              add(m2);
              b.addActionListener(this);
         }Thanks!

  • Line breaks in emails when using Gmail

    *The problem arises because the iPhone uses "Plain Text" to send emails.*
    *When using gmail, gmail automatically inserts line breaks in "Plain Text" emails every 78 characters, the reason why you see the breaks when unexpected.*
    *See: http://www.google.com/support/forum/p/gmail/thread?id=4d1cecc1aab102ef&hl=en*
    *To fix this problem:*
    *1. Apple can allow us to send mail with Rich Text support from iOS devices OR*
    *2. Google has to change the line breaks setting so that Plain text flows (and isn't broken) <-- this option is probably more realistic*
    *I have tried from a hotmail account, sending email as plain text doesn't have line breaks imposed like the gmail account, but rather "flows".*
    *If you want gmail to add a setting to disable line breaks in plain text emails:*
    *Suggest the feature here:*
    *http://mail.google.com/support/bin/static.py?page=suggestions.cs*
    *I chose these categories:*
    *- I have another idea*
    *- Sending and receiving*
    *- - - Composing and delivery*
    *- - - - Sending options*
    *-For comments: Configure or disable plain text wrap length.*

    I am having the same problem with an IMAP/SMTP account. It was a GMail account, I switched it to using the GMail auto setup and haven't had any issues.
    But under the standard IMAP/SMTP setting almost 1/3 of all messages were showing no content.
    Though I don't recall exactly - I think most of them were sent while I was on 3G, and it otherwise works fine on WiFi.

  • DefaultStyledDocument - JTextPane - Forcing Line Breaks

    Well i have a defaultstyled document put into a JTextPane.
    Now when the user puts text into it and it reaches the end of the
    line in the jtextpane it auto word wraps down to the next line.
    HOWEVER, it does not add a line break into the actual document, it is just what the jtextpane does or something.
    What i want is to add a line break into the actual document once it reaches the end of the line and auto wraps down to the next line.
    Any suggestions how to do this easily?

    Move to top. Need a solution.

  • IMovie capture from DV tape without auto scene break

    Has anyone figured out to prevent iMovie from automatically inserting scene breaks in iMovie'11.
    I am importing previously edited footage for conversion.  This still contains the timestamps.
    After importing, iMovie automatically places each clip by time/date order in Events - which means it is jumbled up because it has previously been edited.
    Basically what I want is either 1) to import as a single clip, i.e. disable auto scene break, or 2) to be able to sort clips into same time/date order that they were imported.
    Cheers

    iMovie will assume that anything imported in DV Stream is coming directly off a camcorder, and therefore will be sorted in chronological order.
    If you still have access to the software where you created these movies, you can share them out in something other than DV Stream.
    For example, if you have iMovie 06, you can import it without auto scene breaks. Then Export Using QuickTime to an mov container in the DV codec. That will produce an mov file that iMOvie 11 will import in the correct order.

  • Exporting EPUB from InDesign CC not including line breaks

    I am done with a book and have it formatted the way I want. I am exporting it to EPUB through InDesign CC and previewing it in iBooks and also through Kindle previewer. Everything is fine except for one thing... where I have created page breaks, the exported file is not including them.
    I tried exporting to HTML just to see what it did and there is no line breaks there. I know its proprietary markup ( in kindle ) but I still would like to include them in a few specific places ( to mark seperations of chapters ).
    In kindle this is the tag they say to use: <mbp:pagebreak />
    In iBooks, I have not yet figured out how to create them, I am going to work on that today once I sort out the kindle version.
    Is there any way to force it to include line breaks on export. Or alternatively, I could export to HTML but I am having trouble figuring out how to go back to the EPUB format from there and also it didn't include the fonts, so there was other issues to consider as I have a custom font I was using for the headers that looks really good and matches the font on the book cover as well... so I really want to keep that consistent if possible.
    Are there any tricks or things I can try here to improve on my workflow and do a better job of seperating the chapters ?

    Ok, I hadn't tested the advanced options out in the export menu. It works and does so on both the iBooks and Kindle previewer.. which is good news since that is really important to me to try and find a workflow I can update both of these formats from when I continue to work on my book.
    The only strange part is that on some chapters its adding an extra blank page between the chapter and the next. What is odd is that it only happens on some of them (in the iBook reader only, the kindle previewer isn't doing this)
    I am going to look into this more closely but its not a major deal as I would prefer a little seperation in the chapters anyways, its not really a bad thing. It is just hard to figure out why its doing this.

  • How to get a line break

    Hi All,
    How do I get a line break within a particular field?
    My DB structure is that I have 4 columns address_line_1, address_line_2 and so on. I cannot select them as different fields because all of them can be null, in which case i pick it from internal_address_line column.
    I use:
    SELECT DECODE(address_line_1, NULL, internal_address_line, address_line_1 || ', ' || Address_Line_2) as ADDRESS
    But instead of th comma separating the 2 address lines I want a line break so that 2 address lines come in 2 separate lines in the output.
    It doesn't allow me to use chr(10) as a line break and gives an error
    I'm using Reports 2.5
    TIA
    Naveen

    Yes, true.
    How about setting up the sections as:
    Section 1 Introduction ('Section num space introduction' in this example - tab may be better)
    Then generate the Contents.
    Then do a GREP find/change on the document after the contents:
    This will add a forced line break and tab after each section number... You might want to specify a para style in the Find Format box too, so that references to Section xx in body text are not altered.
    If you update Contents after this, you will get the line break and tab in the Contents too.

  • Not sure why line break is not working

    Hi all,
    Here is part of my simple Swing application:
    String text1 = "hello";
    String text2 = "world";
    String text3 = text1+"\n"+text2;
    // have also tried (String text3 = text1+"\n\r"+text2;)
    displayField.setText(text3);I supposed that the text3 in the label field (displayField) would display like this:
    hello
    world
    But not, the text3 just displayed in the same line like this instead: helloworld.
    I am not sure why the line break is not working.

    Use HTML for a multiline JLabel.// String text3 = text1+"\n"+text2;
    String text3 = "<html>" + text1 + "<br/>" + text2 + "</html>";db

Maybe you are looking for

  • How to write a requirement for sales order outbound iDOC

    i need to write the requirement for sales order IDOC Please help

  • Costing sheet in control tab of production order

    In OPL8 iam able to configure default cost accountings for production order type but why costing sheet is coming by default in production order costing section. Is there anyway to hide that costing sheet (AUFK-KALSM) from display to the users without

  • Html for an applet with swings in 1.4.1 or 1.3.1

    Can anyone send me an html document to launch the applet in a browser. I have very basic html, but I need one that uses the appropriate plug-in and that has parameters such as height, width, etc. My applet uses tabbed panes, dialog boxes and combobox

  • Script / Smartforms

    Hi all,        Can Anyone Tell me <b>the Script /SMartforms</b> Names For The Below mentioned items <b>Sales and distribution:</b> Quotation Print out sale order print out delivery note print out excise invoice print out performance guarantee. <b>FI:

  • Source System conversion for several production SAP

    Hello all, What kind of customizing in table RSLOGSYSMAP i have to do ? We have 1 DEV and 9 production system P01, P02,  .... P09. In the table i must insert 9 lines, one for each production system ? DEV -> P01 DEV -> P02 DEV -> P09 Or i insert only