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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:24:32+00:00 2026-06-02T07:24:32+00:00

Got another wierd one: Here is my php: echo </tr><tr>; echo <td style=’color:white;’>.$row[‘iDesc’].</td><td>.$row[‘pCnt’].</td><td style=’color:.$color.;’>.$row[‘pDur’].</td><td>.$row[‘pStr’].</td><td>.$row[‘pSpd’].</td><td>;

  • 0

Got another wierd one:

Here is my php:

echo "</tr><tr>";
echo "<td style='color:white;'>".$row['iDesc']."</td><td>".$row['pCnt']."</td><td style='color:".$color.";'>".$row['pDur']."</td><td>".$row['pStr']."</td><td>".$row['pSpd']."</td><td>";
echo "<select name='wield".$row['pNum']."' id='wield".$row['pNum']."' size='1' style='width: 100px;' onChange='wieldit(".$row['pNum'].");'>";
echo "<option value=0>Use On";
$query = "Select item, iDesc from item where iType = 1";
$result2 = mysql_query($query, $_SESSION['connect']);
while ($row2 = mysql_fetch_array($result2)) {
  echo "<option";
  echo " value=".$row2['item'].">".$row2['iDesc']."</option>";
}
echo "</select></td>";
}

Here is my js:

function wieldit(num) {
    var id = "wield"+num;
    var e = $(id); 
    var t =  e.options[e.selectedIndex].value;
    var params = "sWield="+t;
    params += "&sNum="+num;
    new Ajax.Updater('div06', 'php/pack.php', {method: 'get', parameters: params, onComplete: showBody});
}

When I run it the values in the select box are 0, 1, 2, 26, 25,24, 23, 31. For the example I’m running $row[‘pNum’] = 6 and I’m selecting select value 31. When I do alert on params in the js sWield = 0 and sNum = 6. The thing is, sWield should be 31. Ideas?. If I run with different values, say $row[‘pNum’] = 11 and select value 25 in the js sWield = 25 and sNum is 11 the way it should be. Ideas?

  • 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-02T07:24:34+00:00Added an answer on June 2, 2026 at 7:24 am

    Value 31 is the 7th option in your selectbox.
    As Javascript starts counting from 0, it’s displaying 6.

    So it seems it alerts the index in stead of the chosen value.
    You could try to try this, and put quotes around the value:
    <option value='31'>Arms</option>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Yet another PHP question. I've got two arrays: one string-based and the other numeric.
I got the following time series of residuals from another regression. One index is
I've got a wierd bug. I have created a listview with headings using another
I got another problem, this time with tables and their borders in HTML (4.01,
I've got another problem in the same code... I'm getting this error: initialization method
I've got another question regarding to basic Android programming: How can I access the
I've got another problem (which might not be an issue in terms of coding
I just got another assignment for web design. And I was curios how to
I have a domain with host www.mydomainhost.com . Now i got another domain named
I'm trying to get my function to return the data it got into another

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.