A-Lieback
Posts: 4
|
| Posted: 06/15/2007, 3:45 AM |
|
Hello there
I have the following problem.
In a record i need one field that adds two Gets to the URL.
I have(had) the following solution on my mind.
a listbox called "report_lPage" and a hidden field "reports_sPage"
in reports_lPage I add the following Code in the "on Change" Event
report.search.report_sPage.value = report.search.report_lPage.value;
That doesnt seem to work.
I dont know if its the code or the completely wrong logic. Ive never used Java Script before. 
So
I would be happy if someone could give me the right hint
a) on my current solution
or
b) a at all better solution for the problem ;)
Edit:
oh...how rude 
Thank you for wasting your time on me
Edit2:
Im using PHP
but ive posted it in general because my current solution is java-script
|
 |
 |
kevind
Posts: 251
|
| Posted: 06/15/2007, 4:24 AM |
|
hi there,
to read the value of the listbox in Javascript you need to detect which value has been SELECTED. the syntax is something like this:
if document.formname.listboxname.options[0].selected=true
{
document.formname.hiddenField=1
// ^--- i don't think you need to use 'value' to read/set it in javascript
}
i'm no pro on javascript, so you'll have to pick up more info on it and proper syntax. Try searching the net using:
javascript selected listbox options[0].selected
later
kd
_________________
thanks
Kevin
======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
|
 |
 |
A-Lieback
Posts: 4
|
| Posted: 06/18/2007, 2:46 AM |
|
Thank you for your answer
And for those who are interested
this is my solution
in Listname "On Change" Event:
num=document.recordname.listname.value;
document.recordname.hiddenname.value = num;
So...its a bit ineffective. But I didnt get it run with a direct declaration.
|
 |
 |
|