CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 How to match a Complex List Box in Update Mode?

Print topic Send  topic

Author Message
Paulo Fagiani
Posted: 09/03/2002, 6:35 AM

Hi Folks,

My situation is:
- I have a SELECT field with complex values (<option value="9842|JOHN SMITH|GENERAL MANAGER">JSGM01</option>) that are parsed by an JS that runs onChange event and fill up other fields on the form (some hidden, some read-only).
- I need to match this field value (selected flag) after a Insert when i'm browsing that record in the Update mode. Currently it always shows that "Select Value" like if it doesn't found the match to point...

I'm using PHP/MySQL and if i'm not clear enough please ask me more questions, because i lost myself inside this problem and probably not been to specific as you'd need :P
Aulus
Posted: 09/03/2002, 12:42 PM

Hey Paulo,

If you find the answer for that... please let me know and if you could share the JS you use to parse... would be useful!
Paulo Fagiani
Posted: 09/03/2002, 1:10 PM

Hi Aulus,

I still with no solution for that but... anyway here follows the code for the JS (keep on mind to call this function in the OnChange event of the ListBox and to put an ID tag on all objects):

var addrinfo = new Array();
var position = -1;
for (var i=0; i < 2; i++) { // 2 would be the parameters #
addrinfo = document.getElementById("ListBox").value.substring(position +1,position = document.getElementById("ListBox").value.indexOf("|",position + 1));
}
document.getElementById("TextBoxA").value = addrinfo[0];
document.getElementById("TextBoxB").value = addrinfo[1];

any question... tell me...
Paulo Fagiani
Posted: 09/04/2002, 10:06 AM

Hey,

Could anybody try to help me at this thread?? please!
RonB
Posted: 09/05/2002, 3:45 AM

If I understand correctly your listbox was filled manualy and not from database?
If the values from the listbox correspond with the value form the recordset you could parse the value from the record to the select box.

So a solution could be:

in the record set make a hidden box containing the number for the select box(lets call it personell)

Now write the JS function and put it in the head section(html):

function get_personell()
{
if(document.all.personell.value != "")
{
document.all.yourlistbox.value=document.all.personell.value
}

The above could be a solution. If I misunderstood the problem please give me some more information.
The easiest solution would be(I guess) to populate the listbox from the database
and add a parameter to the query(something like where personell_id=personell_id and set the method to url)
You can use the concatenate function in sql to make sure all the info you have in the selectbox is shown)


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.