dikmus
Posts: 19
|
| Posted: 05/30/2005, 9:04 AM |
|
Hi,
On a record form, I have a listbox and text field.
After the user selects a product in that listbox, i want the textbox to be filled with the price of the selected product.
What is the most simple way to do this?
thanks dik
_________________
www.musit.nl |
 |
 |
matheus
Posts: 386
|
| Posted: 05/30/2005, 1:50 PM |
|
onchange from listbox do a submit.
Then DLookup in the textbox the parameter from listbox.
or...
All the data in hidden field, and then made a javascript that change value to textbox where onfocus listbox.
Something like this.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
dik mus
|
| Posted: 05/31/2005, 3:40 AM |
|
The first solution looks good to me. Thanks matheus.
But if I do a lookup, what do i type exactly as criteria, (vb.net) I tried
"ProductId = " & Request.QueryString("Product_id")
But Request.QueryString("Product_id") does not seem to contain anything even after a submit. What am i doing wrong?
thanks dik
|
|
|
 |
matheus
Posts: 386
|
| Posted: 05/31/2005, 4:36 AM |
|
Hi,
I didn't know VB.net, but seems like the parameter doesn't came.
Try a look in Preserve Parameter from Record. If was GET, POST and GET or None.
Seems like need be POST and GET.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
dik mus
|
| Posted: 05/31/2005, 6:00 AM |
|
Hi matheus,
I guess you want to sent the parameter over the URL.
Now I can retrieve that url parameter and put it in a control,
But how can I add the parameter after selecting the value from the listbox?
thanks dik
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 05/31/2005, 6:35 AM |
|
Dik,
If you mean that you want to add parameters to URL after selecting a listbox value you can do it with JS code in listbox onChange event (client side), e.g.
if (window.location.search.length > 1){
window.location.href = window.location.href + '¶m_name=' + param_value;
}
else {
// without amp
window.location.href = window.location.href + '?param_name='+ param_value;
}
_________________
Regards,
Nicole |
 |
 |
matheus
Posts: 386
|
| Posted: 06/01/2005, 4:54 AM |
|
Yeah,
Like Nicole says.
I have a function that get all parameters from form.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
dik mus
|
| Posted: 06/01/2005, 7:23 AM |
|
Thanks nicole and Matheus.
I am still struggeling to pass the parameter after change of the listbox, to the resubbitted form. What kind of parameters are you talking about matheus, and how do you set them?
I should mention I am new to adding code into codecharge. Up till now i tried to do everything with standard grids and record forms, wich can do a lot and in little time. Adding extra code turned out to be much more complicated as i had expected.
|
|
|
 |
matheus
Posts: 386
|
| Posted: 06/03/2005, 4:56 AM |
|
A javascript in onchange or onblur of listbox.
Uses Nicole's code.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
dik mus
|
| Posted: 06/03/2005, 6:16 AM |
|
Nicoles code works fine, but the problem is that it adds a url parameter every time you change the listbox. So if the user changes his/her mind you get two url parameters with the same name.
Since i am looking for a simple solution, i am still wondering if i am going the right way.
|
|
|
 |