Ok, I have ANOTHER REGEX question for everyone. I have a field that has multiple validation steps. The first step is to ensure it isn’t blank, second is to ensure that only between 1 and 3 CAPITAL LETTERS are entered, and third, to ensure it doesn’t contain “[” (an opening bracket will…
Tag: javascript
.map() undefined is not a function in React.js
Right, I’m probably missing the obvious here but I am getting an ‘Uncaught TypeError: undefined is not a function’ I seems to be .map() that’s the problem but I can not see why. If I change it to var ideas = this.state.data I don’t get any errors, the JSON data is formatted corre…
jQuery: trigger event on tab key
I would like to call a function when the tab key is pressed within any field with the name=”notes”. I tried the following but this doesn’t fire (using IE 9). What do I have to change here to make this work at least in IE 8 and IE 9 ? Answer The problem I think is in the type of
Get control attributes with jQuery and create json
I have multiple checkboxes in a view and each one has some data attributes, example: Once the button is clicked I’m iterating through all the checkboxes which are selected and what I want to do is get the data-price and value fields for each selected checkbox and create JSON array. This is what I have s…
Javascript window.print() in chrome, closing new window or tab instead of cancelling print leaves javascript blocked in parent window
In the application I work on, we have several different places a user can print from. In all these cases we are using the same workflow of opening a new window(or tab), writing whatever we need to print to the document of the new window, and then we call The issue I’m seeing is that in Chrome, if I clos…
jQuery – Can not select first option on last optgroup
I have small problem. I need select option from <select> A, which triggered action and select his first <option> in <select> B by value from selected <option> from A. Everything works fine, but I can’t select ONLY last optgroup and his option. Try to look at jsfiddle This bug see…
Jquery/ajax Looping SetTimeout
Hi I’m stuck on my setTimeout function. What i’m trying to do is to loop my setTimeout for my retrieve conversation function.. I have tried this on setInterval but using setInterval is a badnews for my application which is why I switch to setTimeout.. But I cant seem to figure out how to make the …
Insert Multiple CSS rules into a stylesheet
Okay, So I need to add rules to a style sheet, but it also needs to be cross browser, so I need multiple rules. Now I can get one working (Chrome) with a singular line. However, I can’t find any documentation or anything related to multiple lines. The idea is to add multiple css animations using browser…
FullCalendar – Only display ‘allDay’ slot when in agenda view (weekly or daily)
My application only deals in full day events, so I’d like to be able to only display the allDay section for agendaViews. See screen shot below. I want to hide the areas highlighted in red. Calendar widget: http://arshaw.com/fullcalendar/ Screens: Answer You overcomplicated it. Check the basicViews, http…
Load different content onclick of different controls
I am trying to load different content onclick of different button controls. Since I am new to JavaScript and don’t know where I am doing wrong. It will be highly appreciated if there is any help from any one of you! The code of which is here: and the HTML code is here: and same code is on jsfiddler as