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

  • Home
  • SEARCH
  • 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 6244981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:25:32+00:00 2026-05-24T12:25:32+00:00

This string has a php echo. I must have messed something up because it

  • 0

This string has a php echo. I must have messed something up because it seems to cause a JS error. I have tried everything I can think of to get this to work. If I take the php string out everything works. AND if I take the PHP select and place it outside the jquery string that works. I guess I just need some help combining the PHP string and the JS. (ignore the string spacing I only did that so that it is easier to read)

Thanks for any help.

$("#billTasks").find('tr').append('
<td>
<select class="billOptions">
        <option class="fixedRate" onclick="fixedOption(this)">Bill Fixed Rate</option>
        <option class="hourly"  onclick="hourlyOption(this)">Bill Hourly</option>
</select> 
        <input type="text" name="fixedRate" placeholder="Rate" class="fieldWidth100 rate"/>
<select>
<?php while($row = $db->sql_fetchrow($result)){echo "<option value=\'.$row[schedule].\'> $row[schedule] </option>\n";}?>
</select>
</td>');
  • 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-24T12:25:34+00:00Added an answer on May 24, 2026 at 12:25 pm

    You have a couple issues with this line:

    echo "<option value=\'.$row[schedule].\'> $row[schedule] </option>\n";
    

    The first is the .‘s You are not using string concatenation so you don’t want dots around your variable. Since it is a complex variable your code would be better like {$row[schedule]}.

    Secondly you need to put quotes around the string schedule otherwise PHP searches for a constant with that name before throwing a warning and using it as a string. So the line will end up looking like:

    echo "<option value=\'{$row['schedule']}\'>{$row['schedule']}</option>\n";
    

    Javascript also doesn’t like newline characters in a string unless the are written literately \n. Meaning that you should change your \n to \\n, so that php outputs \n instead of an actual newline character:

    echo "<option value=\'{$row['schedule']}\'>{$row['schedule']}</option>\\n";
    

    Or use PHP single quotes and do:

    echo '<option value="'.$row['schedule'].'">'.$row['schedule'].'</option>\n'; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey. I have an object that has a string property called BackgroundColor. This string
I have a string that has HTML & PHP in it, when I pull
I have this HTML: <?php if(!empty($_GET['pID'])) $the_pID = mysql_real_escape_string($_GET['pID']); #echo $the_pID; ?> <form action=inc/q/prof.php?pID=<?php
I have a file called function.php that has a function like this: public function
Has anyone else seen people do this: private string _name; public string Name{ get{
Python has this wonderful way of handling string substitutions using dictionaries: >>> 'The %(site)s
bCrypt's javadoc has this code for how to encrypt a password: String pw_hash =
I have this string 'john smith~123 Street~Apt 4~New York~NY~12345' Using JavaScript, what is the
I've tried this: string newScript = textBox1.Text; HtmlElement head = browserCtrl.Document.GetElementsByTagName(head)[0]; HtmlElement scriptEl =
I'm using Kohana 3, which has full support for Unicode. I have this as

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.