Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

Discuss "Dynamic dropdown not fit in column" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). The Classic ASP forum is for ASP/VBScript and ASP/JScript applications.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old August 19th, 2008, 12:11 PM
guddu's Avatar
Barn Frequenter

 
Join Date: Jul 2008
Location: Oxford UK
Posts: 129
Thanks: 6
Thanked 3 Times in 2 Posts
Rep Power: 1
guddu is on a distinguished road
Default Dynamic dropdown not fit in column

hi
i m creating dropdown on the fly.i m calling this function FillProtocolSettingNo see bold line.but problem is my dropdown is not creating at that column.it create drop down outside of that table.why this happening?

Code:
StrDisplay = StrDisplay & "<TR class=""HeaderRow"">"					
			StrDisplay = StrDisplay & "<TD align=""left"">"& FillProtocolSettingNo()& "</TD>"
			StrDisplay = StrDisplay & "<TD align=""left"">"& FillDocumentTypeNo()& "</TD>"
			StrDisplay = StrDisplay & "<TD align=""left""><INPUT type=""text""></TD>"
			StrDisplay = StrDisplay & "<TD align=""left""><INPUT type=""text"" ></TD>"
			StrDisplay = StrDisplay & "<TD align=""left""><INPUT type=""text"" ></TD>"
			StrDisplay = StrDisplay & "<TD align=""right"" colspan=""2""><input type=""button"" name='btnAdd_"& vlMemberID &"' value=""Add Settings""></TD>"
			StrDisplay = StrDisplay & "</TR>"
			StrDisplay = StrDisplay & "</TBODY>"
			StrDisplay = StrDisplay & "</TABLE>"
			Response.write StrDisplay
Code:
Function FillProtocolSettingNo()
	Dim rstProtocolSettingNo
	On Error Resume Next 
	Set objData = Server.CreateObject("ProtocolSettings.clsSearcher")		
	Set rstProtocolSettingNo = objData.FillProtocolSettingNo()
	If Not rstProtocolSettingNo.EOF Then 		
		Response.write "<select id=""cboProtocolSettingNo"" name=""cboProtocolSettingNo"" style=""width:180px"">"
		Response.write "<option>---- Select ProtocolSettingNo ----</option>"
			While Not rstProtocolSettingNo.EOF
				Response.write "<option value="& rstProtocolSettingNo("ProtocolSettingNo") & ">" & rstProtocolSettingNo("Description") &"</option>"
				rstProtocolSettingNo.movenext
			Wend 
		Response.write "</select>"
	End If 
	If (err.number <> 0) Then strMsg = "Please resolve this error  " & err.description
	Set objData = Nothing
End Function
same probelm with this dropdown also.

Thanks
__________________
Love is physical attraction and mental destruction
Reply With Quote
Sponsored Links
  #2  
Old August 19th, 2008, 12:14 PM
mehere's Avatar
Super Sarcasm Mistress


 
Join Date: Mar 2008
Location: Wide Awake In Dreamland
Posts: 143
Thanks: 10
Thanked 27 Times in 25 Posts
Rep Power: 1
mehere will become famous soon enough

Awards Showcase
Microsoft SQL Server Classic ASP 
Total Awards: 2

Default

remove the On Error Resume Next and see if you get an error.
__________________
Quote of the Month:
Regret: It hurts to admit when you make mistakes - but when they're big enough, the pain only lasts a second.

Questions to Ponder:
Could it be that all those trick-or-treaters wearing sheets aren’t going as ghosts but as mattresses?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright © 2008 sbenj69
Reply With Quote
  #3  
Old August 19th, 2008, 12:17 PM
guddu's Avatar
Barn Frequenter

 
Join Date: Jul 2008
Location: Oxford UK
Posts: 129
Thanks: 6
Thanked 3 Times in 2 Posts
Rep Power: 1
guddu is on a distinguished road
Default

i m not getting any error .drop down is populating well.only dropdown not fix up with in that column of table.it goes to outside of the table.
Reply With Quote
  #4  
Old August 19th, 2008, 12:18 PM
guddu's Avatar
Barn Frequenter

 
Join Date: Jul 2008
Location: Oxford UK
Posts: 129
Thanks: 6
Thanked 3 Times in 2 Posts
Rep Power: 1
guddu is on a distinguished road
Default

dropdown should bind in this column of table
StrDisplay = StrDisplay & "<TD align=""left"">"& FillProtocolSettingNo()& "</TD>"
Reply With Quote
  #5  
Old August 19th, 2008, 12:19 PM
mehere's Avatar
Super Sarcasm Mistress


 
Join Date: Mar 2008
Location: Wide Awake In Dreamland
Posts: 143
Thanks: 10
Thanked 27 Times in 25 Posts
Rep Power: 1
mehere will become famous soon enough

Awards Showcase
Microsoft SQL Server Classic ASP 
Total Awards: 2

Default

do you have an opening table and tbody tag? i don't see them in your code. just trying to narrow this down. i see nothing in the code i've seen so far that would render it outside the table.
Reply With Quote
  #6  
Old August 19th, 2008, 12:20 PM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

I think if you're using a function you'll need to return the code rather than just using response.write, which just writes it to the screen. Something like:-
Code:
Function FillProtocolSettingNo()
	Dim rstProtocolSettingNo, returnddl
	On Error Resume Next 
	Set objData = Server.CreateObject("ProtocolSettings.clsSearcher")		
	Set rstProtocolSettingNo = objData.FillProtocolSettingNo()
	If Not rstProtocolSettingNo.EOF Then   
  returnddl =  "<select id=""cboProtocolSettingNo"" name=""cboProtocolSettingNo"" style=""width:180px"">"
    returnddl = returnddl & "<option>---- Select ProtocolSettingNo ----</option>"
			While Not rstProtocolSettingNo.EOF
    returnddl = returnddl & "<option value="& rstProtocolSettingNo("ProtocolSettingNo") & ">" & rstProtocolSettingNo("Description") &"</option>"
				rstProtocolSettingNo.movenext
			Wend 
returnddl = returnddl & "</select>"
	End If 
	If (err.number <> 0) Then strMsg = "Please resolve this error  " & err.description
	Set objData = Nothing
 
return returnddl
'or I think you can also set the name of the function to the value to return FillProtocolSettingNo=returnddl

End Function
Then if you use:-
Code:
response.write(FillProtocolSettingNo)
that should write out the code...I think...

Hope that helps.

Comments on this post
guddu agrees: Thanked Post
Reply With Quote
The Following User Says Thank You to richyrich For This Useful Post:
guddu (August 19th, 2008)
  #7  
Old August 19th, 2008, 12:27 PM
guddu's Avatar
Barn Frequenter

 
Join Date: Jul 2008
Location: Oxford UK
Posts: 129
Thanks: 6
Thanked 3 Times in 2 Posts
Rep Power: 1
guddu is on a distinguished road
Default

yup u are rite.Thanks a lot RR.
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dropdown list Shem .Net Development 5 May 27th, 2008 01:39 PM
Dynamic dropdown list with multiple records Rebelle ASP Development 4 April 30th, 2008 05:33 AM
Concatenation of Column Data function AOG123 Microsoft Access 0 March 25th, 2008 06:53 AM
Creating Dynamic Dropdown Menu!? jarvelous ASP Development 1 March 20th, 2008 12:30 PM
[SQL] Concatenation of Column data function.... Lauramc Code Samples 0 March 17th, 2008 12:32 PM


All times are GMT -4. The time now is 04:53 PM.



Content Relevant URLs by vBSEO 3.2.0