Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Old 02-20-2006, 08:30 AM Refresh Combobox
Junior Talker

Posts: 1
Trades: 0
Hi,

I would like to ask you about combobox refershing. My code is:

Code:
<title>none</title>
<body>

<table border="1" width="100%" cellspacing="0" cellpadding="2">
<%
dim m_DB
dim RS

set m_DB = Server.CreateObject("ADODB.Connection")
set RS = Server.CreateObject ("ADODB.Recordset")

m_DB.ConnectionString = "dsn=Test;"
m_DB.Open

i=1
%>
Select Site Code 
<select name="site" style="width: 250px" onchange="txt();">

<%if i=1 then%>
<%

RS.Open "select * from mrs ORDER by mrs.sites", m_DB

'mezok
do while not RS.EOF 

response.write("<option value='" & RS("sites") & "'>" & RS("sites"))

RS.MoveNext
loop
RS.Close

%>
<%end if%>

</select>
<script language="VBScript">
dim prevscode


function txt()

'msgbox "sfs"
'msgbox site.value
prevscode = site.value
table.value = site.value

End function

function adding()

Dim Con
Dim strQuery 
Dim rst 
 
Set con = CreateObject("ADODB.Connection") 
con.Open "Provider=sqloledb;Data Source=eurdsql1; Initial Catalog=EURsEDD_MRS;Integrated Security = SSPI;" 

strQuery="INSERT INTO sites VALUES ('" & table.value & "')" 
Set rst = con.Execute(strQuery) 
table.value=""
rst.close
con.close

end function

</script>

</table>

<br>
<table border="1" width="80px" cellspacing="1" cellpadding="2">
<input type="text" name="table" value="" style="width: 90px">
</table>
<br>
<input type="submit" name="action1" value="Insert Site" onclick="adding()" style="width: 90px">
<input type="submit" name="action2" value="Delete Site" onclick="deletes()" style="width: 90px">
<input type="submit" name="action3" value="Modify Site" onclick="ch()" style="width: 90px">

</body>
How can O silve, that the values of the combobox always refresh from database, what I declare at the top, when I click on a "Refresh" button?

Thanks.
sici22 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-21-2006, 03:19 PM Re: Refresh Combobox
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
not sure what you are asking, and your code above won't work at all because you are trying to run server side code clientside
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-19-2008, 03:50 PM Re: Refresh Combobox
Junior Talker

Posts: 4
Name: dragon
Trades: 0
Quote:
Originally Posted by chrishirst View Post
not sure what you are asking, and your code above won't work at all because you are trying to run server side code clientside
he's right
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
dbzanime is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Refresh Combobox
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16067 seconds with 12 queries