jm
|
| Posted: 03/20/2005, 2:10 AM |
|
Is it possible to change from a listbox to a txt box and keep the function the same as in the listbox :
For instance in the example Master-Detail Form for Order Entry in the order entry step 8 it asks to change the txt field into a listbox set the connection and chose the data source etc, I would like to find how to do the same but in txtbox If you can give a detail info I will appreciated
Thank you
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 03/20/2005, 7:21 AM |
|
Yes, you can use textbox instead of listbox. You can just skip step 8 in that example.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
jm
|
| Posted: 03/22/2005, 2:54 AM |
|
Yes but would it function the same way? so if I enter a product in the txtbox would I get the price and the quantity fields in the other txtbox(s)?
Thank you
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 03/23/2005, 1:00 AM |
|
Hello,
Textbox works in the same way only if user enters ID of an item, not its Text value. Because exactly ID is used in calculation code fired for onChange event of a listbox
_________________
Regards,
Nicole |
 |
 |
jm
|
| Posted: 03/23/2005, 12:25 PM |
|
Thank you for the info, but I would like to know how to use a txtbox to have the same functinality, and not use the id field but another field
Thank you
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 03/23/2005, 12:42 PM |
|
There is no difference between Listbox and Textbox except that Listbox can show some associated information. But that 'extra' information is not used anywhere, only displayed in the listbox to help users make correct selection. Thus changing a listbox to textbox and vice-versa doesn't have any effect on the functionality. Only when using Textbox the users will not see the additional information and must know the ID to enter.
Thus when you say "I would like to know how to use a txtbox to have the same functinality, and not use the id field but another field". The answer would be: both listbox and textbox have the same functionality and none of them uses "another field". The listbox only shows "another field" but it doesn't use it anywhere.
If you need some specific functionality then maybe please explain what you need without referring to listbox. This can help us understand your requirement, rather than comparing listbox to textbox. So let's forget about listbox if you don't need it 
I suspect that you want to populate some fields based on other fields on the page, or you want to populate some fields based on other fields in the database. Could you please explain.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
jm
|
| Posted: 03/23/2005, 1:33 PM |
|
Hi Peter
you are correct all I want is to populate some fields based on other fields in the database, so when I type a txt or a # in the the txtbox I would like to see the related data, as in the example I would like to type the name of the product and see in the other txtboxs the price of the item etc
Thnak you
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 03/23/2005, 2:19 PM |
|
You know, maybe now I understand what you meant by changing listbox to textbox. The only issue was that "step 8" in that example was referring to the Customer selection listbox which doesn't do anything, but now it looks like you need something similar to the "Product" listox on that page, which retrieves Unit Price and populates another field. I think that steps 13, 21-22 describe that part. Now everything is more clear and your initial question becomes more valid. Though still it's probably not relevant that it is a listbox, thus I think that those steps 13,21,22 would work with a textbox. There is custom code to create an array of all possible "product_id" values with associated pricing, then when someone selects/enters product_id then JavaScript is used to populate another field based on array value.
So I would think that the exact code shown in that example should work for you. Unfortunately I haven't test it in such away thus if something doesn't work for you there it can be little tricky to fix as it may require JavaScript knowledge. I don't know JavaSciript but possibly someone else on the forums can help once you implement it and describe the problems or errors.
Another solution might be to retrieve those related database values on the fly, as shown in this example: http://examples.codecharge.com/CCSExamplePack2/Retrievi...ieldsValues.php
When a Customer is selected there then the Address/City/State/Zip are all retrieved from the database and used to populate other textboxes. That example should also work without changes if you use textbox instead of listbox.
Please only note that both those examples require some experience with CCS and possibly JavaScript to be able to implement a few lines of code, then test and debug it, and make changes if needed.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|