Solved

jquery change input box value

Posted on 2010-08-30
5
824 Views
Last Modified: 2013-11-11
hi,

 using jquery I am trying to set an input box value but I cannot seem to grab it properly.
 
I only know the title of the input box which is Order Number.

please tell me how to set a value for Order Number. (see code below)

thanks.
<td class="orderQty selected">
<span> inputbox</span>
<span> <input title="Order Number"/></span>
</td>

Open in new window

0
Comment
Question by:Solutionabc
5 Comments
 

Author Comment

by:Solutionabc
ID: 33562609
This does not work for me.

$(".orderQty selected span input [title = Order Number]").val(order);
0
 
LVL 58

Expert Comment

by:cyberkiwi
ID: 33562651
$(".orderQty input[title='Order Number']")
0
 

Author Comment

by:Solutionabc
ID: 33562720
I need the class="orderQty selected". Because I am only applying it to certain td's. when the page loads all of them are called orderQty and I cannot apply it to all 150 items because of loading time.

I can only use class "orderQty selected".
0
 
LVL 14

Accepted Solution

by:
Designbyonyx earned 500 total points
ID: 33563103
$('.orderQty.selected input[title=Order Number]').val();
0
 
LVL 6

Expert Comment

by:hehdaddy
ID: 33564164
Simple:

$("input[title='Order Number']").val("my value");

Cheers!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question