473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Update classes

Expand|Select|Wrap|Line Numbers
  1. function setBrand()
  2. {
  3.     var Brand = document.getElementById("Brand")
  4.     var updateclass = getElementsByClass("Brands")
  5.     updateclass.value = Brand.options[Brand.selectedIndex].text
  6. }
  7.  
  8. function getElementsByClass(cName) {
  9.        var tabReturn = new Array();
  10.       var tabTmp = new Array();
  11.       tabTmp = document.getElementsByTagName("*");
  12.       j=0;
  13.        for (i=0; i<tabTmp.length; i++) {
  14.            if (tabTmp[i].className==cName) {
  15.              tabReturn[j]=tabTmp[i];
  16.          j++;
  17.            }
  18.         }
  19.        return tabReturn;
  20.     }
Expand|Select|Wrap|Line Numbers
  1. <tr>
  2.             <td><select id="Brand" name="Brand" onchange="setBrand()">
  3.             <option>Select</option>
  4.             <?php 
  5.                 $sql = "SELECT * FROM `go3_brand`";
  6.                 $result = &$dbconn->query($sql);
  7.                 while ($row = $result->fetch()) {
  8.                         print "<option value=\"$row[id]\">$row[brand]</option>";
  9.                 }
  10.             ?>
  11.             </select></td>
  12.             </tr>
  13.             <tr>
  14.             <td><input type="text" class="Brands" value="" /></td>
  15.             </tr>
I've been scowering the web and am unable to find how to update all classes in a document with a certain value which is entered within an input...
Any idea why this doesn't work or links to else where to go
Nov 8 '06 #1
1 1392
iam_clint
1,208 Expert 1GB
Please explain alittle better "Exactly" what you want it to do. Then maybe we can get your started on fixing your problems.
Nov 8 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: jn | last post by:
I have a page that shows info from MySQL. It is for an online education site. It uses different classes arranged in a hierarchy. Each lesson is roughly laid out like this: Lesson |-Intro |...
3
by: chrisspen | last post by:
Is there a way to loop through all instantiated objects and update their classes when a source file changes? I know about Michael Hudson's method...
1
by: jijo kuruvila | last post by:
actually my code looks like this private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { DataGrid1.Columns.Visible=true;...
4
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void...
1
by: chris | last post by:
I am new to web services but want to know if it would be a viable solution for a project we are considering. I have a site in the US that i want to use a webservice to pull data out off SQL Server...
30
by: Bruce Momjian | last post by:
I have events in the next few weeks in New York City, Copenhagen, Paris, and Atlanta. Check the News section on the web site for more information. I will also be in Amsterdam February 2-3, though...
8
by: Vivek | last post by:
Hi, I wish to update the LIST<T> created in PARENT FORM from the CHILD FORM. Currently I have declared the LIST<Role> as public in my parent form. What can I do to update the <LIST>? Thanks
5
by: Dave Smithz | last post by:
Hi there, Been working on an evolving DB program for a while now. Suddenly I have come across a situation where I need to update a table based on a group by query. For example, I have a table...
6
by: Dixie | last post by:
I have asked this question before, but I could not get the suggested solution work. So I will give more details this time. I have an append query that adds several hundred records to a table...
6
by: | last post by:
Hi, I'm steel trying to read and update my XML file with Visual Basic Express but i am unable to find the right way to read my xml file and update it if neccessary... Here is my problem :...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.