hi all
In my project I want to pass multiple text box values to java script.
The textboxes are generated by dynamic is it possible to do that..
I need ur suggestions to achieve this
How to pass dynamic text box value to js
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
I don't believe I have misunderstood you at all. You simply place the JavaScript in the document after the textareas have been generated and get the information. Do you have any experience with the DOM?
I'm not sure why you can't handle this particular example in PHP since the data is generated by PHP.
I'm not sure why you can't handle this particular example in PHP since the data is generated by PHP.
hi superdesign
Check this
I want to display all the values entered into the text box.
Check this
Code: Select all
<? foreach($resultinvdetails->result() as $row)
{?>
<tr>
<td class="td18"><input type="text" class="price" name="color" value="<?=$row->OPTION_LIST?>"></td>
<td class="td19"><?=$resultmaininventory->WSELLING_PRICE?>/gross</td>
<td class="td20">Qty:<input type="text" id="1" name="name" size="1" value="0" onBlur="findtotal(this);"></td>
<td class="td21"><?if($row->OUT_OF_STOCK=='O'){echo "SOLD OUT";}else{echo "";}?></td>
</tr>
<?}?>As superdezign indicated, you could do that in PHP, just create another textbox and fill it with the content that you want.vinoth wrote:I want to display all the values entered into the text box.Code: Select all
<? foreach($resultinvdetails->result() as $row) {?> <tr> <td class="td18"><input type="text" class="price" name="color" value="<?=$row->OPTION_LIST?>"></td> <td class="td19"><?=$resultmaininventory->WSELLING_PRICE?>/gross</td> <td class="td20">Qty:<input type="text" id="1" name="name" size="1" value="0" onBlur="findtotal(this);"></td> <td class="td21"><?if($row->OUT_OF_STOCK=='O'){echo "SOLD OUT";}else{echo "";}?></td> </tr> <?}?>
If, for some other reason, you really need to do it after the page is loaded in the browser, you will need to add a name= parameter for the other two <td>s, just as you did with the first one, so that you can access them in Javascript, usually by using getElementByName().