tc3596
Technical User
- Mar 16, 2001
- 283
I am knew to javascript, so I hope this question doesn't seem too novice. Basically a user types in a customer number and I need to populate a customer name.
I have a built in function that will do the lookup when you pass it the table, field and where claus. Here is the line of code...
document.getElementById('cus_name_value').innerHTML = '<%=Trim(""&GetField("vwBrowser_Company", "WHERE CustomerNo = ' + document.frmMain.cus_no.value + '", "CustomerName")) %>';
If I take out the ' + document.frmMain.cus_no.value + ' piece and replace it with a real value like 000000000883, it all works fine. I get back the correct cust name and the input field gets populated correctly. I am sure I am missing an apostrophe or something simple. Just an fyi...I do an alert(document.frmMain.cus_no.value); right before this and it sends back 000000000883 as expected.
Thanks.
I have a built in function that will do the lookup when you pass it the table, field and where claus. Here is the line of code...
document.getElementById('cus_name_value').innerHTML = '<%=Trim(""&GetField("vwBrowser_Company", "WHERE CustomerNo = ' + document.frmMain.cus_no.value + '", "CustomerName")) %>';
If I take out the ' + document.frmMain.cus_no.value + ' piece and replace it with a real value like 000000000883, it all works fine. I get back the correct cust name and the input field gets populated correctly. I am sure I am missing an apostrophe or something simple. Just an fyi...I do an alert(document.frmMain.cus_no.value); right before this and it sends back 000000000883 as expected.
Thanks.