ahill Posted August 21, 2015 Share Posted August 21, 2015 I am currently using the CSS width: 100% property in my drop down list in my classic asp page. My JavaScript call this asp page and does the work from there. My box displays fine in Google chrome amd wraps the text to the box but the css is ignored in Internet Explorer and runs off the page. Any ideas how to work around this? Link to comment Share on other sites More sharing options...
thescientist Posted August 21, 2015 Share Posted August 21, 2015 can we see the CSS and HTML? Link to comment Share on other sites More sharing options...
ahill Posted August 26, 2015 Author Share Posted August 26, 2015 (edited) here is what the box currently looks like Edited August 31, 2015 by ahill Link to comment Share on other sites More sharing options...
ahill Posted August 31, 2015 Author Share Posted August 31, 2015 Hey guys I have a search box that works but I have 2 issues.1. I cant get the text to wrap.2. I cant put space between each of my results like a <br>Everything else works except for these two issuesHere are the links to my codeIndex------------------------------http://www.codelocker.net/30493/searchbox/livesearch-------------------------------http://www.codelocker.net/30494/searchbox/ Link to comment Share on other sites More sharing options...
justsomeguy Posted August 31, 2015 Share Posted August 31, 2015 One problem is that your ASP page is returning a complete HTML document. You don't put one HTML document inside another one, it should only return a snippet of HTML that you'll add to the parent page. Link to comment Share on other sites More sharing options...
ahill Posted September 1, 2015 Author Share Posted September 1, 2015 took the html out. still no luck. Have tried every style I can think of but it still wont text wrap Link to comment Share on other sites More sharing options...
justsomeguy Posted September 1, 2015 Share Posted September 1, 2015 .wrapword{white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */white-space: -pre-wrap; /* Opera 4-6 */white-space: -o-pre-wrap; /* Opera 7 */white-space: pre-wrap; /* css-3 */word-wrap: break-word; /* Internet Explorer 5.5+ */white-space: -webkit-pre-wrap; /* Newer versions of Chrome/Safari*/word-break: break-all;white-space: normal;width: 160%;;}First, it doesn't really do anything to duplicate all of those properties, it's going to use the last value. It's going to use "normal" for white-space and "break-all" for word-break. Second, giving an element a width greater than 100% is going to cause part of that element to be hidden, part of the text is also going to be hidden. Third, text inside select options does not wrap at all, the select box will match the size of the longest option unless you restrict it to be smaller, and if so the text will just get cut off. If you want text to wrap then you need to use a fake select box which is made from other elements like divs. jQuery has several plugins to replace standard select elements with more flexible things, for example. Link to comment Share on other sites More sharing options...
ahill Posted September 1, 2015 Author Share Posted September 1, 2015 Any chance you could show an example of the wrapping. I had to do the 160% because I had to put the box -px to make it extend to the left of the box so I could only use 160% to make it go to the right. it still cuts it off if I use lets say 60%. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 1, 2015 Share Posted September 1, 2015 There's a jQuery plugin here:https://github.com/fnagel/jquery-ui/wiki/SelectmenuThere's a link on that page to the demo. Link to comment Share on other sites More sharing options...
ahill Posted September 1, 2015 Author Share Posted September 1, 2015 So sorry for being new, but is jQuery something that has to be installed or is it a part of JavaScript? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 1, 2015 Share Posted September 1, 2015 It's a third-party library. There are several other plugins like that one. That one in particular doesn't say it requires any certain version of jQuery, so I imagine the most recent version would work. Link to comment Share on other sites More sharing options...
ahill Posted September 1, 2015 Author Share Posted September 1, 2015 It's a third-party library. There are several other plugins like that one. That one in particular doesn't say it requires any certain version of jQuery, so I imagine the most recent version would work.So I don't need any software installed on my server to use it? do I just put a link into the code to a library? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 1, 2015 Share Posted September 1, 2015 You don't need to install software. It's a Javascript file that you link like any other Javascript file. There are places that host it where you can link to it on their server, or you can upload a copy of it to your server and link to it there. If you want to use it you should probably learn about it.http://learn.jquery.com/about-jquery/ Link to comment Share on other sites More sharing options...
ahill Posted September 3, 2015 Author Share Posted September 3, 2015 so looking at some scripts basically I just have to replace the <select> </select> with the Jquery script Link to comment Share on other sites More sharing options...
justsomeguy Posted September 3, 2015 Share Posted September 3, 2015 Yeah, the plugin would replace the select element with a widget that works similarly but has more features available to it. Link to comment Share on other sites More sharing options...
ahill Posted September 4, 2015 Author Share Posted September 4, 2015 (edited) Ok so I found an example and fixed it to work with my database but cant get it to text wrap correctly. can I get a little help with the csshttp://www.codelocker.net/30498/select-list-jquery/ Edited September 4, 2015 by ahill Link to comment Share on other sites More sharing options...
justsomeguy Posted September 4, 2015 Share Posted September 4, 2015 You can paste code directly in your post, there's a code box that will highlight it.What exactly happens when you run that? Is the code you showed there the response to an ajax request? If so, Javascript code doesn't automatically execute if you use something like innerHTML to add it to the page. Link to comment Share on other sites More sharing options...
ahill Posted September 4, 2015 Author Share Posted September 4, 2015 yes it displays as a dropdown of results in an Ajax search box. looks the same as when I started but is not text wrapping yet. I believe I have the jquery there now but need to figure what css property is used to wrap the text in jquery Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now