The problem I had is that both search ‘forms’ existed on one Web Form, and I was using Validation controls to check each. So when using either submit button, both search groups were validated together. Not useful when I wanted to submit each set of controls independently of each other. So there I was, coding to disable either set of validation controls when a submit button is clicked.
“Validation groups!” I hear you cry. Yes, I know that now.
]]>I never finished the article, so I’ll explain here how I implemented this using CodeIgniter. I’ll also detail how I built the ‘quick results’ tool (click in the search box).
]]>In an attempt to challenge my OS of choice, but still keeping within my Ubuntu comfort zone, I installed Linux Mint last week. Once slated as just a friendly, sexier version of Ubuntu, it now seems to be gaining in popularity.
I’m very impressed. I installed the OS, development IDE (Eclipse based Aptana), Apache, PHP, MySQL, and had the development version of this site up and running within a couple of hours. No messing around getting Flash, RealPlayer, and various audio/video codecs running. Anything I did need to install was a simple apt-get away in the Ubuntu repositories.
]]>I build many .net applications that require date entry, so I implement the Date Picker control often. Unfortunately, there is a problem when it is used on a field that is validated using a .Net validation control. Upon clicking on a date, I get the following error:
length is null or not an object
This only occurs when using Internet Explorer. Currently, my only solution is to edit the source code. Locate the following code in jquery-ui.js or ui.datepicker.js:
inst._input.trigger('change')
Replace it with:
if (!$.browser.msie){inst._input.trigger('change')}
This prevents the change event firing in IE.
I wouldn’t normally advocate changing source code in this manner, as it makes future upgrades tedious. Hopefully it will be addressed in a future release.
]]><asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server"> <asp:TextBox Id="Firstname" Runat="Server" /> </asp:Content>
The output is rendered as:
<input name="ctl00$Content$FirstName" type="text" id="ctl00_Content_FirstName" />In the example above, the disparity in the rendered id attribute occurs because the TextBox control has been placed within a Content control, as the Page object inherits a MasterPage.
So how can you robustly reference the control using client-side JavaScript, regardless where the control resides? Using jQuery it’s fairly trivial:
var $firstname = $("[id$=FirstName]");
This little snippet makes use of the jQuery attributeEndsWith selector, as documented here. Bare in mind that an array is returned, as any control with an id that ends in FirstName will be selected.
]]>I’ve looked at a few, for example: Swish-e, and Sphider. Nothing really float my boat, until I had a look at the Zend Framework. It’s another MVC based PHP framework, though it looks a little heavier than CodeIgniter. The documentation is not as good either, but it did have a Lucene library.
]]>A quick google led me to this article by Dan Webb. Looks like a common technique. Very useful article, though I needed to be able to pass parameters to the functions. There may be a better to way to do this, but this is how I achieved it.
]]>Whilst looking for a way to use jQuery instead of the stock Microsoft client library, I came across this excellent article.
There doesn’t seem to be too much on Web about this subject. Maybe most .Net developers stick to Microsoft tools, but I like using jQuery for all my client scripting, and would rather not use more than one library. So as it look me a while to get example code working, I’ve included my efforts.
]]>So today I took a look at jQuery, a JavaScript framework. I have to admit, I’m pretty impressed. It did not take me long to come up with some example code, that degrades well when JavaScript is disabled in the browser.
]]>The main point of this site has been completed. I’ve stumbled upon one of the best lightweight frameworks I have ever used, and decided to build an application.
The framework is CodeIgniter. It uses the MVC design pattern methodology.
]]>