JavaScript to parse text

Discussion in 'Software' started by Publius, Jun 30, 2007.

  1. Publius

    Publius Sergeant

    Another question, hopefully not as trivial as the last.

    Is there a way to use javascript to parse portions of a textarea into specific text boxes on a web page? The attached image is an example of what I want to do. The user pastes data into a text area and I need the individual text boxes to the right to be populated with the corresponding data so that the text boxes can be used to populate a database. If it is easier, the text boxes don't necessarily have to be on the same page, I can have them on a subsequent form and have them populated when the first form with the textarea is submitted.
     

    Attached Files:

  2. matt.chugg

    matt.chugg MajorGeek

    the split() function will let you split a string into an array of values.

    so if you were to split by a line break then you would have an array containing all the linesthen loop through each line and spit it into its individual parts.

    Are you running any server side scripting ? it may be easier to submit the form and seal with the value using php/asp(.net) and then populate the boxes.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds