Search Results

Search found 1787 results on 72 pages for 'inline'.

Page 16/72 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Why does cloning the django inline formsets result to forms with similar ids and names?

    - by user1289167
    In my project I use django inline formsets. I got the jquery to clone the formsets but unfortunately the cloned forms have the same names and ids and so data entered in the last one overwrites the data from the first form. What could I be doing wrong? Here is the script: <script type="text/javascript">> function cloneMore(selector, type) { var newElement = $(selector).clone(true); var total = $('#id_' + type + '-TOTAL_FORMS').val(); newElement.find(':input').each(function() { var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-'); var id = 'id_' + name; $(this).attr({'name': name, 'id': id}).val('').removeAttr('checked'); }); newElement.find('label').each(function() { var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-'); $(this).attr('for', newFor); }); total++; $('#id_' + type + '-TOTAL_FORMS').val(total); $(selector).after(newElement); } </script>

    Read the article

  • How to display inline several <li> with 100% width?

    - by Rui
    Hi, I have the following html: <div id="container"> <ul> <li>element 1</li> <li>element 2</li> </ul> </div> applied with a css as follows: #container { width:100%; overflow:auto; } #container ul { width: 100%; } #container li { width: 100%; } So now I would like to have an indeterminate number of elements (<li>) all with 100% width (so they can adjust accordingly to the browser's window size) but all side by side, displaying the horizontal scroll bar in the container. I have tried putting "display:inline" on ul's css, and "float:left" on li's css, but with no success. Any suggestions? Also, try to consider I'm trying to make this as "cross-browser compatible" as possible. Thanks in advanced;

    Read the article

  • Why is this UL and inline JS giving errors during HTML validation?

    - by thor
    I've just run the homepage of a site I'm working on through the w3c HTML validator and it's come back with 3 errors and 2 warnings. I've taken a look at them but can't see why they would be causing a problem. I've pasted them in below (I've removed URL's/strings etc as the site isn't quite ready to be made public yet). This is being validated against XHTML Transitional by the way. The UL comes back with the following error: end tag for "ul" which is not finished <ul id='tabs'></ul> <ul id='tabs'> <li> <a href="/en/folder/folder/search?categories[]=cat1" class="tab1" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab1_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat2" class="tab2" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab2_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat3" class="tab3" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab3_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat4" class="tab4" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab4_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat5" class="tab5" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab5_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat6" class="tab6" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab6_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat7" class="tab7" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab7_text </span> </a> </li> <li> <a href="/en/folder/folder/search?categories[]=cat8" class="tab8" title="tab_title"> <img alt="img_alt" src="img_src" /> <span> tab8_text </span> </a> </li> </ul> For the inline javascript, I'm getting 2 errors and 2 warnings all for the same thing - I have a simple if statement with && and the validator appears to be seeing this as HTML rather than javascript: character "&amp;" is the first character of a delimiter but occurred as data and xmlParseEntityRef: no name <script type='text/javascript'> if (weather_data != null && weather_data['data'] != null){ display_weather(); } </script> The javascript is placed just before the body close tag at the end of the document. If you need to see the full source then let me know and I can send it over.

    Read the article

  • Methodology for Documenting Existing Code Base

    - by George Stocker
    I work as part of a team on an existing application that has no inline documentation, nor does it have technical documentation. As I've been working on various bug reports on the application, I've written a sort of breadcrumb trail for myself - bug numbers in various places so that the next developer can refer to that bug number to see what was going on. My question is thus: What is the most effecient method for documenting this code? Should I document as I touch the area (the virus method, if you will), or should I document from each section on its own, and not follow paths that branch out into other areas of the application? Should I insert inline comments where none previously existed (with the fear that I may end up incorrectly identifying what the code does)? What method would you use to accurately and quickly document a rather large application that has no existing inline documentation, nor inline references to external documentation?

    Read the article

  • ASP.NET MVC search box: use modal popup or inline div or redirect to another page?

    - by JK
    I have a view with a textbox and a search button, eg CustomerTextBox and CustomerSearchButton. The list of customers is too long to display in a dropdown, and there has to be advanced search functions anyway. What is the best practice in MVC to handle this case? When the user clicks on the search button, should it: A. Load another view into a modal popup (eg /customers/search)? How would you do this in MVC, just set popupWindow.location.href = '/customers/search'? How would you return the value to the main view? B. Have the search form in a hidden div that expands when the search button is clicked? How would be done? a partial view maybe? C. Redirect the user to a search page by means of RedirectTo("/customers/search")? How would you return the value to the main class? I've only been doing MVC for 3 days so thanks to those who answer my questions that might have quite obvious answers that I cant see yet. :)

    Read the article

  • How do I convert some ugly inline javascript into a function?

    - by Taylor
    I've got a form with various inputs that by default have no value. When a user changes one or more of the inputs all values including the blank ones are used in the URL GET string when submitted. So to clean it up I've got some javascript that removes the inputs before submission. It works well enough but I was wondering how to put this in a js function or tidy it up. Seems a bit messy to have it all clumped in to an onclick. Plus i'm going to be adding more so there will be quite a few. Here's the relevant code. There are 3 seperate lines for 3 seperate inputs. The first part of the line has a value that refers to the inputs ID ("mf","cf","bf","pf") and the second part of the line refers to the parent div ("dmf","dcf", etc). The first part is an example of the input structure... echo "<div id='dmf'><select id='mf' name='mFilter'>"; This part is the submit and js... echo "<input type='submit' value='Apply' onclick='javascript: if (document.getElementById(\"mf\").value==\"\") { document.getElementById(\"dmf\").innerHTML=\"\"; } if (document.getElementById(\"cf\").value==\"\") { document.getElementById(\"dcf\").innerHTML=\"\"; } if (document.getElementById(\"bf\").value==\"\") { document.getElementById(\"dbf\").innerHTML=\"\"; } if (document.getElementById(\"pf\").value==\"\") { document.getElementById(\"dpf\").innerHTML=\"\"; } ' />"; I have pretty much zero javascript knowledge so help turning this in to a neater function or similar would be much appreciated.

    Read the article

  • How to insert inline content from one FlowDocument into another?

    - by Robert Rossney
    I'm building an application that needs to allow a user to insert text from one RichTextBox at the current caret position in another one. I spent a lot of time screwing around with the FlowDocument's object model before running across this technique - source and target are both FlowDocuments: using (MemoryStream ms = new MemoryStream()) { TextRange tr = new TextRange(source.ContentStart, source.ContentEnd); tr.Save(ms, DataFormats.Xaml); ms.Seek(0, SeekOrigin.Begin); tr = new TextRange(target.CaretPosition, target.CaretPosition); tr.Load(ms, DataFormats.Xaml); } This works remarkably well. The only problem I'm having with it now is that it always inserts the source as a new paragraph. It breaks the current run (or whatever) at the caret, inserts the source, and ends the paragraph. That's appropriate if the source actually is a paragraph (or more than one paragraph), but not if it's just (say) a line of text. I think it's likely that the answer to this is going to end up being checking the target to see if it consists entirely of a single block, and if it does, setting the TextRange to point at the beginning and end of the block's content before saving it to the stream. The entire world of the FlowDocument is a roiling sea of dark mysteries to me. I can become an expert at it if I have to (per Dostoevsky: "Man is the animal who can get used to anything."), but if someone has already figured this out and can tell me how to do this it would make my life far easier.

    Read the article

  • Underline ie6-bug. Inline element in <a> tag.

    - by kalininew
    There is a markup: <a href="#"> lorem ipsum<span>15</span> </a> There are styles: a{ text-decoration: underline; } a span{ background: #fff; //To clean the bottom underlining under <span> } Works in all interesting me browsers. Except IE6. The bottom underlining under <span> remains. How to solve this problem without changing a markup.

    Read the article

  • Trim "Minify" inline css at runtime, expand it at edit time.

    - by Scott B
    My custom WP theme has a text block in the theme options panel that allows the user to create and maintain a custom css block that is applied to the site template at runtime. I would like to trim or "minify" this content before its stored in the database, but retain all the whitespace when its presented back to the user for editing. Would this be possible? For example, if the user has entered the following as their custom css code... .red {color:red;} .green {color:green;} .blue {color:blue;} Then I would like to store it in the database as: .red{color:red;}.green{color:green;}.blue{color:blue;} But still display it as it was input (ie, retain all the white space and line breaks) when the user is editing the content via my theme options panel.

    Read the article

  • Native (non-jqueryui) way to set prompt() input field inline.

    - by Anthony
    I might just be using the wrong keywords on Google, but what I have in mind is: -------------------------------- | What is your mailbox? | | | | [ ]@mail.example.org | | | | [OK] [Cancel] | -------------------------------- The idea being that the input field is followed right behind by the mail server name, to help avoid instances where: If I don't make it follow right behind, the user puts in the whole thing, If I default it to "[email protected]" they delete the server name. In either case, it's not too big a deal, as I will know that if the returned value does have the server, to remove it and if doesn't, I know what server it belongs to, but I think this visual aid will be a better user experience and lower the amount of validation worries I tend to get.

    Read the article

  • How to make this into a self contained jQuery plugin? Works inline.

    - by Jannis
    Hi, I have been trying to make this to be a little jQuery plugin that I can reuse in the future without having to write the following into my actions.js file in full. This works when loaded in the same file where I set the height using my variable tallest. var tallest = null; $('.slideshow img').each(function(index) { if ($(this).height() >= tallest ) { tallest = $(this).height(); } }); $('.slideshow').height(tallest); This works and will cycle through all the items, then set the value of tallest to the greatest height found. The following however does not work: This would be the plugin, loaded from its own file (before the actions.js file that contains the parts using this): (function($){ $.fn.extend({ tallest: function() { var tallest = null; return this.each(function() { if ($(this).height() >= tallest ) { tallest = $(this).height(); } }); } }); })(jQuery); Once loaded I am trying to use it as follows: $('.slideshow img').tallest(); $('.slideshow').height(tallest); However the above 2 lines return an error of 'tallest is undefined'. How can I make this work? Any ideas would be appreciated. Thinking about this even more the perfect usage of this would be as follows: $('.container').height(tallest('.container item')); But I wouldn't even know where to begin to get this to work in the manner that you pass the object to be measured into the function by adding it into the brackets of the function name.. Thanks for reading, Jannis

    Read the article

  • How can I run a user script before any inline scripts run on a webpage?

    - by Telanor
    I want to make a greasemonkey type script for firefox that runs before the scripts on the page. Greasemonkey scripts run after scripts on the page, so that won't work. The reason I need this is because I want to edit one of the scripts on the page. Specifically, I want to delete a script that forces the page to load inside a frame since having the page inside a frame breaks F5 (Pressing F5 makes the page jump back to the front page instead of reloading the current page). Also, I don't want to load the page through a proxy with AJAX and switching to chrome/opera is not an option either. I was thinking maybe the Jetpack add-on would work but it seems to only have the same event that greasemonkey uses, DOMContentLoaded. Any ideas?

    Read the article

  • How can I refactor this to use an inline function or template instead of a macro?

    - by BillyONeal
    Hello, everyone :) I have a useful macro here: #define PATH_PREFIX_RESOLVE(path, prefix, environment) \ if (boost::algorithm::istarts_with(path, prefix)) { \ ExpandEnvironmentStringsW(environment, buffer, MAX_PATH); \ path.replace(0, (sizeof(prefix)/sizeof(wchar_t)) - 1, buffer); \ if (Exists(path)) return path; \ } It's used about 6 times within the scope of a single function (that's it), but macros seem to have "bad karma" :P Anyway, the problem here is the sizeof(prefix) part of the macro. If I just replace this with a function taking a const wchar_t[], then the sizeof() will fail to deliver expected results. Simply adding a size member doesn't really solve the problem either. Making the user supply the size of the constant literal also results in a mess of duplicated constants at the call site. Any ideas on this one?

    Read the article

  • PHP - what is the proper way to do inline HTML variable output?

    - by edmicman
    I just moved from an Ubuntu PHP workstation dev environment back to Windows and am using xampp. I have a bit of code, like so: <input type="text" name="txtEmail" value="<?=$emailaddress;?>"/> that I swear worked to display the variable in the textbox when I was developing before. But when I loaded the page on Windows/xampp it just put that text between the quotes in the textbox. Instead, I ended up changing it to something like: <input type="text" name="txtFirstName" value="<?php echo($firstname);?>" /> The latter makes sense, but I guess I thought there was a shorthand or something, and I must be going crazy because I'm sure the first way was working on a difference environment. So what's the best way to do this?

    Read the article

  • CKEditor adds html entities to inline CSS. Is the CSS still valid?

    - by Mihai Secasiu
    I have this piece of code: <table style="background-image: url(path/to_image.png)"> And when I load it in CKEditor it's transformed in: <table style="background-image: url(&quot;path/to_image.png&quot;)"> Is this still still valid CSS? Actually I'm not so interested if it's valid but if there would be any problems with any web browser or email client ( the editor is used for composing a html email ). Firefox and Thunderbird seem to be fine with it.

    Read the article

  • Where do I put inline script in head with Zend Framework?

    - by Joel
    I'm reading the manual here: http://zendframework.com/manual/en/zend.view.helpers.html but I'm still confused. I have a script in my head that I'm converting to the layout/view for the Zend MVC: <script type="text/javascript"> var embedCode = '<object data="http://example.com" type="application/x-shockwave-flash" height="385" width="475"><param name="src" value="http://example.com" /><param name="allowfullscreen" value="true" /></object>' </script> I first tried to add it is an external file like this (in layout): $this->headScript()->appendFile('js/embeddedVideo.js')->appendScript($onloadScript); <head> <?php echo $this->headScript(); ?> </head> Didn't really work, but anyway, I'm wanting to just add the script and not add it as an external file. How do I do that? Thanks!

    Read the article

  • Why not put all braces inline in C++/C#/Java/javascript etc.?

    - by DanM
    Of all the conventions out there for positioning braces in C++, C#, Java, etc., I don't think I've ever seen anyone try to propose something like this: public void SomeMethod(int someInput, string someOtherInput) { if (someInput > 5) { var addedNumber = someInput + 5; var subtractedNumber = someInput - 5; } else { var addedNumber = someInput + 10; var subtractedNumber = someInput; } } public void SomeOtherMethod(int someInput, string someOtherInput( { ... } But why not? I'm sure it would take some getting used to, but I personally don't have any difficulty following what's going on here. I believe indentation is the dominant factor in being able to see how code is organized into blocks and sub-blocks. Braces are just visual noise to me. They are these ugly things that take up lines where I don't want them. Maybe I just feel that way because I was weened on basic (and later VB), but I just don't like braces taking up lines. If I want a gap between blocks, I can always add an empty line, but I don't like being forced to have gaps simply because the convention says the closing brace needs to be on its own line. I made this a community wiki because I realize this is not a question with a defined answer. I'm just curious what people think. I know that no one does this currently (at least, not that I've seen), and I know that the auto-formatter in my IDE doesn't support it, but are there are any other solid reasons not to format code this way, assuming you are working with a modern IDE that color codes and auto-indents? Are there scenarios where it will become a readability nightmare? Better yet, are you aware of any research on this?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >