Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6571511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:53:31+00:00 2026-05-25T14:53:31+00:00

I am sending a form with a notes field to an Oracle database and

  • 0

I am sending a form with a notes field to an Oracle database and then displaying the notes. New notes can be added, and they will be appended to the previous note.

The problem I have is with the newline that I am inserting at the beginning of each notes update. I am sending notes updates to the database with a javascript in this manner: oldNote + "\n" + date + " " + username + ": " + newNote;.

This is the php part:

echo "<input class='button' type='button' id='Save' name='saveInteraction' onclick=\"saveInteractionInfo('$oldNote', '$date', '$username', '$interactionId', '$seqNum');\" value='Update'/>";

This is the entire javascript function:

function saveInteractionInfo(oldNote, date, username, interactionId, seqNum) {
    var formData = {};
    formData['interactionId'] = interactionId;
    formData['seqNum'] = seqNum;
    formData['notes'] = oldNote + "\n" + date + " " + username + ": " + document.all.notes.value;
    trxId = readCookie("transactionId");
    if(trxId)
        formData["transactionId"] = trxId;
    var respFunc = function(par1,par2,par3,par4) { postUpdateInteractionNotesResponseHandler(par1,par2,par3,par4); };
    var errorFunc = function(reqId) { return showErrorCaseHandler(reqId); };
    ajaxPostRequest("Interactions.php",formData,"Update Interaction Notes.","subExtra",respFunc,errorFunc);
}

Updating the notes works at it should, but when trying to update it for the second time I get an error in Firebug: unterminated string literal: saveInteractionInfo('Test, where saveInteractionInfo is the function I am passing the notes to and ‘Test’ is the form value. So the error occurs when the newline is passed to the function.

Any suggestions how I could get this working?

UPDATE So the problem is that the $oldNote has line breaks (\n) in it, which stops it from passing the data to the javascript function.
The tag now:

<input class='button' type='button' id='Save' name='saveInteraction' onclick="saveInteractionInfo('fdsfsfsf
dfdfdf
gdfgdg', '13/09/2011 16:11:13', 'blaha01', '7038245', '2');" value='Update'/>

The tag as it should be:

<input class='button' type='button' id='Save' name='saveInteraction' onclick="saveInteractionInfo('fdsfsfsfdfdfdfgdfgdg', '13/09/2011 16:11:13', 'blaha01', '7038245', '2');" value='Update'/>

Any other suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:53:32+00:00Added an answer on May 25, 2026 at 2:53 pm

    The solution was similar to the one posted by Rob W:

    $oldNote = str_replace("\r\n", "\\n", $oldNote);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am submitting a form to my MySQL database using PHP. I am sending
i have a contact form sending itself to me by email using ASP classic,
I have a form that is sending in sizes of things, and I need
What techniques are available for sending an email via a webpage or a form
I have an HTML form - with PHP, I am sending the data of
I have some problems sending an id though jquery. I have a form select
I'd like to see what a website is sending when I submit a form.
I want to encode my php sending form in my language. What is wrong
I have an issue regarding sending form values to a script. I have a
I am aware of sending form values using the method=get <FORM METHOD=get ACTION=test.html> I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.