Can the attribute data-filter-placeholder be customized? I've been wanting to have that change based on a filter that is selected.
So placeholder defaults to "search", but if they select Location from the filter list, I'd like it to change to "Search Location". I tried something like below but, obviously, it's a greasefire. Has anyone ever attempted this?
I'm working on some code to automatically change the font-size based not only on $(window).resize() but also to ensure it the text doesn't wrap, and instead shrinks to the size of its container. I do not care if the size ends up at 4...just so long as it does not wrap.
Here is my .js attempt //it works great with the resize, but the text wraps if the input is too long
$(document).ready(function () { //set the originals var originalWinHeight = $(window).height(); var originalWinWidth = $(window).width();
//set the original font size var originalFontSize = getOriginalFontSize();
//set the ratio of change for each size change var ratioOfChange = 50;
//set the font size using jquery $("#Full").css("font-size", originalFontSize);
$(window).resize(function () { //get the width and height as the window resizes var winHeight = $(window).height(); var winWidth = $(window).width();
//get the difference in width var widthDiff = winWidth - originalWinWidth;
//check if the window is larger or smaller than the original if (widthDiff > 0) { //our window is larger than the original so increase font size var pixelsToIncrease = Math.round(widthDiff / ratioOfChange);
//calculate the new font size var newFontSize = originalFontSize + pixelsToIncrease;
//set new font size $("#Full").css("font-size", newFontSize); } else { //our window is smaller than the original so decrease font size var pixelsToDecrease = Math.round(Math.abs(widthDiff) / ratioOfChange);
//calculate the new font size var newFontSize = originalFontSize - pixelsToDecrease;
//set the new font size $("#Full").css("font-size", newFontSize); } }) });
getOriginalFontSize = function () { var windowWidth = $(window).width(); var thisFontSize = windowWidth / 50; if (thisFontSize > "16") { thisFontSize = "16"; } return thisFontSize; }
I have messed with the css property white-space:nowrap;, That stops wrapping, but simply overruns, rather than shrink down. Any help you have would be appreciated.
I have a simple checkbox. I need to know if it's end position is on or off upon submit. The problem is that no matter if the button is clicked once or twice, the ALERT is always "on"... I need to know how to make it "true" if clicked and "false" if unclicked...or ON/OFF...either way. I've tried a couple things but to no avail.
I used checkboxes recently to allow a box to be selected if yes or if no. The problem is that the boxes can both be checked at the same time. I'd like them to toggle the other if checked.
So if "Yes" is checked, then "No" would uncheck.
Below is my code. The buttons work great. The checking to see if a value is true, then setting it to false works...but the checkbox button still reads as though selected.
I recently started using JQuery after about a 3-year lapse. Needless to say, I'm quite rusty. I have a button that, when clicked, needs to send various variables to a .php file containing the appropriate function. My issue is that the button will click, any test alerts pass the appropriate values into said alert...however nothing fires off on my .php file. I'm at a loss. The function below exists inside of the $(document).ready
$(function() {
$( "#buttonSubmit" )
.click(function()
{
$.post(
//"../customwidgets/survey/surveyF.php",
"surveyF.php",
{
"function": "sendVisitorSurvey",
"f_dateAttended": dateAttended,
"f_welcome": welcome,
"f_messageFeedback": messageFeedback,
"f_ageGroup": ageGroup,
"f_heardAboutUs": heardAboutUs,
"f_questions": questions,
"f_childHasChildren": childHasChildren,
"f_childClassAttended": childClassAttended,
"f_childClassFeedback": childClassFeedback,
"f_childCheckIn": childCheckIn,
"f_contactName": contactName,
"f_contactEmail": contactEmail,
"f_contactPhone": contactPhone
}
);
/* alert(
"Date Attended?: "+dateAttended+"\n"+
"Did you feel welcome?: "+welcome+"\n"+
"Feedback on the message?: "+messageFeedback+"\n"+
"What is your age group?: "+ageGroup+"\n"+
"How did you hear about us?: "+heardAboutUs+"\n"+
"Do you have any questions?: "+questions+"\n"+
"Have Children?: "+childHasChildren+"\n"+
"What class attended?: "+childClassAttended+"\n"+
"Class Feedback from child?: "+childClassFeedback+"\n"+
I posted this in the UI group and was told to put it in here... My problem is that I have a function that is to call blockUI both upon login and logout. BlockUI only fires upon logout. Here's my code: **code** function Processing(dataString,l_processing,control) { if (l_processing == "yes") { $().ajaxStart(function() { $.blockUI( { message: $ ('img#l-processing'), css: {
ReloadPage(); } else if(control == "login") { $.ajax({ type: "POST", url: "login.php", data: dataString, }); ReloadPage(); //return false; } } l_processing = "no"; control = "no"; } **end code** All vars are being passed correctly. "else if(control == "login")" fires just fine, within the "if(l_processing == "yes")", but the BlockUI portion does not start. However, when control = "logout" BlockUI starts up just fine. I've done alerts and find that all variables being sent into the function are populating as they should. Any ideas?
My problem is that I have a function that is to call blockUI both upon login and logout. BlockUI only fires upon logout. Here's my code: **code** function Processing(dataString,l_processing,control) { if (l_processing == "yes") { $().ajaxStart(function() { $.blockUI( { message: $('img#l-processing'), css: { border: 'none', padding: '15px', backgroundColor: '#000', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', '-ms-filter': 'progid:DXImageTransform.Microsoft.Alpha (Opacity=50)', 'filter': 'progid:DXImageTransform.Microsoft.Alpha (Opacity=50)', opacity: '.5' } }) }); if(control == "logout") { $.ajax({ type: "POST", url: "logout.php", data: dataString, }); ReloadPage(); } else if(control == "login") { $.ajax({ type: "POST", url: "login.php", data: dataString, }); ReloadPage(); //return false; } } l_processing = "no"; control = "no"; } **end code** All vars are being passed correctly. "else if(control == "login")" fires just fine, within the "if(l_processing == "yes")", but the BlockUI portion does not start. However, when control = "logout" BlockUI starts up just fine. I've done alerts and find that all variables being sent into the function are populating as they should. Any ideas?
I realize that there are numerous posts on this subject. But, alas, I will start with the same phrasing that everyone else does. "This works in FF, but not in IE". So, having said that, I'm not using the .min Jquery file, I'm using the developers file. I debugged it using Firebug Lite in IE8, as well as IE8's Dev console. Here is what the errors were: Firebug: "Invalid argument. (jquery-1.3.2.js,1061)" IE8 Dev: Specific Line in the above js file is: if ( set ) elem[ name ] = value; return elem[ name ]; Now, I have a similar page that runs just fine in IE, making similar calls. So I assume that it's only a syntax error. But for the life of me I cannot find it. I know that the error occurs when I click on a button (code shown below): html += '<img src="/demo_images/walkin_search.ico" title="Search for User" onClick="addEvent(\'' + e_id + '\'); return false;" />'; To call a function (showm below): function addEvent(e_id) { event_id = e_id; $('#dialog-search').dialog('open'); } Which, in turn, calls a modal (code below): $('#dialog-search').dialog( { bgiframe:true, autoOpen:false, title:"Search For User", resizable:false, height:200, modal:true, closeOnEscape:false, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { 'Search': function() { firstname_s = $('#s-firstname').val(); lastname_s = $('#s-lastname').val(); validate = true; validate1 = true; allFields_s.removeClass('ui-state-error'); validate1 = validate && FillCheck(firstname_s,"At least 1 field must be filled in",$('#s-firstname'),$('#tips-search')); validate = validate && FillCheck(lastname_s,"At least 1 field must be filled in",$('#s-lastname'),$('#tips-search')); if(validate1 || validate) { UserSearch("user",firstname_s,lastname_s,""); $('#dialog-no_user').dialog('close'); $(this).dialog('close'); } }, 'Cancel': function() { $(this).dialog('close'); } }, close: function() { $('#s-firstname').removeClass('ui-state-error'); $('#s-lastname').removeClass('ui-state-error'); } }); $('#button-newsearch').click(function() { $('#dialog-search').dialog('open'); }) .hover( function(){ $(this).addClass("ui-state-hover"); }, function(){ $(this).removeClass("ui-state-hover"); } ).mousedown(function(){ $(this).addClass("ui-state-active"); }) .mouseup(function(){ $(this).removeClass("ui-state-active"); }); I realize that I may not have given enough nuggets for anyone to be able to help, so if you need more, just let me know. Thanks for your time, Shadraq
I have created a payment system using Jquery. The problem I run into is when I move from http to https. I get the following error: Error: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: "https:// www.stirthewater.com/scripts/js/jquery-1.3.1.min.js Line: 19"] Source File: https://www.mysite/scripts/js/jquery-1.3.1.min.js Line: 19 I spent roughly 3 hours on Google trying to find a solution to this library cross-port call. It's possible I didn't see the right article. However, if someone could toss me a lifeline and help me out, it would make my day. Thanks, Shadraq
I have a function that is calling a list of events. Within the <code>.each</code> is alternating row colors code (see below): function DisplayEventList(info,event_id) { $.post('/url/server.php', { request:info, event_id:event_id }, function(xml) { $('#event-listing tbody').empty(); $(xml).find('list').each(function() { var startdate = $("start",this).text(); var location = $("location",this).text(); var event_name = $("event_name",this).text(); var speaker = $("speaker",this).text(); var e_id = $("event",this).text(); if(info == "specific") { var currentpricing = $("current_pricing",this).text(); } $('#event-listing tbody tr:odd').css("background-color", "#EFF1F1"); $('#event-listing tbody tr:even').css("background-color", "#A4D1FF"); var html = '<tr height="35" style="font-size:smaller;" align="center">'; html += '<td>' + startdate + '</td>'; html += '<td>' + location + '</td>'; html += '<td>' + event_name + '</td>'; html += '<td>' + speaker + '</td>'; if(info == "specific") { html += '<td>' + currentpricing + '</td>'; } html += '</tr>'; $('#event-listing tbody').append($(html)); }); }); } ***END CODE*** And my table looks like: <table id="event-listing" width="100%" class="ui-widget ui-widget- content" cellspacing="0"> <thead> <tr class="ui-widget-header" style="font-size:small"> <th> </th> <th>Begins</th> <th>Location</th> <th>Event</th> <th>Speaker</th> <? if($_GET['event']) { ?> <th>Current Pricing</th> <? } ?> </tr> </thead> <tbody> </tbody> </table> ***END CODE*** My problem is that the last line of my returned rows isn't coloring. If 14 rows return, the first 13 will alternate coloring, but the 14th will not. Consequently, if only 1 line is returned, it does not color. Thanks for your time, Shadraq
I've designed a payment system that, generally gets a response quickly. However, if there is any delay at all, customers will click "Pay" again, thinking that they didn't hit it. This, of course, will cause duplicate transactions. I'm looking for some sort of "Please wait while we process your request." message/decal/modal that freezes the screen while the payment is processing, and releases once a response comes back from the server. Any ideas/links to examples. I googled and searched the UI...and didn't find anything that I could use. It is likely I missed something. Thanks, Shadraq
I am running into an odd issue. I have a UI modal dialog box that asks the user to "Submit" or "Cancel". Both buttons unleash various actions. The problem I am running into is when the user closes the box by clicking "x" on the top right of the box, rather than "Cancel". No actions are unleashed when that happens. I have implemented closeOnEscape:false to remove that option, but I am wondering if: a) the "x" can be removed, or b) the "Cancel" actions can be assigned to the "x" (preferable option) Thanks for you time, Shadraq