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 8949459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:13:21+00:00 2026-06-15T13:13:21+00:00

A page has a playscript in a php included file: (the playscript has hundreds

  • 0

A page has a playscript in a php included file: (the playscript has hundreds of lines)

With php I’ve manipulated the playscript to contain certain tags
<lineNo1>, <charName1> and <dialogue1>

Using <?php echo $i;$i++;?>, I’ve incremented the whole script so it has 25 Lessons, each with 10 lines of dialogue, and each line of dialogue displays those parameters correctly, i.e.:

<div id="dialogue">
<div id="1">
<Lesson1>Lesson 1</Lesson1>
<lineNo1>1</lineNo1>) <charName1>Sherry</charName1>
<dialogue1>Look at this, I'm shaking.</dialogue1></div></div>

All that php works great through 250 iterations, but my jquery skills are nascent and my script is bogus.

On click of <Insert>Insert</Insert>, I need to transfer the text values, i.e. ‘1’, ‘Sherry’ and ‘Look…shaking.’ from inside the tags to form text input fields,
LIne, Speaker and LIneX:

<div id="LessonNumber1">
<div id="LineNumber1">
<input type="text" name="Line" id="Line" value="" />
<input type="text" name="Speaker" id="Speaker" value="" />
<input type="text" name="LineX" id="LineX" value="" />
</div></div>

My jquery script, below, works partially. The first input text field, ‘Line’ is receiving the (<?php echo $LineItem;?>).text; value perfectly, for obvious reasons.
But the other fields are receiving [object Object]; all my research on [object Object] has led me in circles, ultimately here.
Will someone please tell me how to re-write the last two lines, for #Speaker and #LineX so that the actual values will appear in the form fields instead of [object Object]?

<script type="text/javascript">
$(document).ready(function(){
$("Insert").click(function(){
$("#TheForm #LessonNumber<?php echo $LineItem;?> #LineNumber<?php echo $LineItem;#Line").val(<?php echo $LineItem;?>).text();

These last two are examples of my problem.
$("#TheForm #LessonNumber1 #LineNumber1 #Speaker").val("what goes here if not <charName1></charName1>").val();
$("#TheForm #LessonNumber1 #LineNumber1 #LineX").val("what goes here if not <dialogue1></dialogue1>").text();});});</script>

Many thanks.

  • 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-06-15T13:13:23+00:00Added an answer on June 15, 2026 at 1:13 pm

    val and text are functions, you must add () to call them and get their results. If you
    juste write val or text, it’s the reference to the function itself (and in js, a function is an object).

    myfield.val( mytext.text() ); 
    

    this will set the value of input field ‘myfield’ with the text inside the element ‘mytext’

    Try to do the same in your code

    $("#TheForm #LessonNumber1 #LineNumber1 #Speaker").val( $('your_selector').text() );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I show phpinfo() info page has pgsql enable support But in file php $dbconn
An ASPX page has an embedded SWF Object pulling settings from a config file.
The page has link to the text file placed somewhere in the network. If
My page has a div where the content is written by a PHP script.
A page has many tags. How do I loop through all of them and
An .aspx page has a .pdf file in it, like this: <embed src=http://.../ShowPdf.aspx?id=1 type=application/pdf>
ok assume i have php page has this name name.php?get= and has get varible
Page has menu items that would replace a 'div id=foo_(current menu item)' with 'div
This page has been quite confusing for me. It says: Memory management in newLISP
The page has a container div which holds multiple content divs. Each content div

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.