This content has been marked as final. Show 11 replies
Sorry, I meant "Passing List Box Value in URL". doh!
use whatever logic you used to name and give values to your check boxes to produce that variable.
I tried that first. I tried referencing the recordset that fills in the box, but no matter which value I selected from the list box, it would only pass the first value of the list. That's why I thought I should reference the list box by ID instead of the recordset that fills it out.
I'm guessing wildly here, since we have not seen any code.
This sounds like it might be a client problem. Where you have a list
control and you want to submit the value of the list control.
If so, then you are either looking at just making the form method="get"
But without any code and|or a much clearer idea of your requirements I
can not get more specific.
Since the value from the listbox gets selected on client-side (after CF has processed the page on server-side, and sent it to the client), CF will not know which value is currently selected in the listbox.
Have a look at the function below, and google for more info if necessary.
<div onclick="window.open('page.cfm?ID='+ document.getElementById('x').value ,'', '');">edit</div>
<select id="x" name="somelistbox">
I'm not using a form, but I may need to go that direction. As I have several different edit pages I would need to go to (a different one per list box), multiple forms with multiple submit buttons may be the way to go.
I'm still having no luck. Here's my function in the header:
var Purpose = document.getElementById("Purposes").value;
and here's my code in the link:
<td><div align="center"><a href="purposeEdit.cfm?Purpose_ID=getValue()">EDIT</a></div></td>
this is the code I used in my list box...+this.value get whatever the value the user pick on the list box and use it in the url.
Hope it helps you
get, parameter. Can you? I sure have never seen anything like that and
it does not make sense to me.
I would expect to see something like this....
<a href="purposeEdit.cfm" onClick="GetValue();">EDIT</a>
Then the getValue() function would do something to pass that parameter
on to the next page.
Thanks anyway everyone.
I wound up using multiple forms on the same page (one for each list box), and it works great. Thanks again all.