JQuery :: Passing Variable Gives Empty String
Oct 5, 2011
I have this image gallery in which clients should be able to determine the order in which their images are shown. The sortable part works. Then I want to pass the new order to the next page called act_writeneworder.cfm (i am using coldfusion)
I just started with jQuery and it is driving me nuts:-) Each time I think I am having it well i am testing and the variable passed through gives an empty string.
My code:
<script type="text/javascript">
$(function() {
$( "#ulsortable" ).sortable();
});
[Code]......
View 2 Replies
ADVERTISEMENT
Aug 10, 2010
Two objects on an html page. An event on object 1 effects object 2
$(".video_rg").mouseover(function(event){
var myTriggerId = event.target.id;
var myTargetId = 'video_' + myTriggerId;
document.getElementById(myTargetId).src = 'images/test_object_2.gif'; // this works
// $('#myTargetId').src = 'images/test_object_2.gif'; // this does not
});
My assumption (we know about those) is that I am not passing the data to the $() function correctly, that it is reading '#myTargetId' as a string, and not a variable. I just really want the JQuery code that would do what the document.getElementById code is doing.
View 2 Replies
View Related
Oct 10, 2010
var months = "April Showers";
document.write('<p><img src="ad11.jpg");
document.write(" alt=");
document.write(months);
document.write(">");
document.write(months);
How come when I display my output to a browser without the presence of the
ad11.jpg file, only the first word (April) in the text string "April Showers" is dispayed where the .jpg file is suppose to be...but the last line displays the entire text string.
View 8 Replies
View Related
Dec 21, 2011
I have a form with an id "modClassForm" when I try:$("#modClassForm").serialize() it returns an empty string ("") When I get the action attribute it's right so it is the form I was expecting. When I do the following:
$("#modClassForm input").val()
it returns "retret" (the contents of the input element in that form). So what is doing this? The only thing I can think of is that this form is loaded from ajax and then placed in the page using the .html(htmlString) method which is rather core to my design. This works in a whole lot of other browsers (IE 9, FF 6-8, Chrome 13-15 and Safari 5). So I know I could try to serialize the fields myself, but the form content has two modes and I'd have to construct a fairly large string and I'm not sure about encoding. Is there any other way to make serialize work? Some way to get it to recognize the contents of the form?
View 2 Replies
View Related
Feb 8, 2010
I'm trying to compare a <div> background color with another color. However, on FireBug, I noticed that my <div> doesn't have a background color code in it (I placed document.getElementById(o) on watch), even though I have already specified on my css. As a result, I'm comparing an empty string with another color code. Why is this so ?
Javascript:
function highlight(o) {
var color1;
color1 = document.getElementById(o).style.backgroundColor;[code].....
View 2 Replies
View Related
Jun 10, 2009
i have a problem dealing with an xmlhttprequest with the POST method: i receive a string from a java applet in my page and i want to use this string as a post parameter to send an xmlhttprequest, but once i send the request the string becomes empty. i put some debug alert before invoking the send method and they show the string properly. the string comes from a new String(byte[]) in java, so i thought maybe there's somethinig related to the charset?
View 5 Replies
View Related
Aug 13, 2010
So I'm having some issue with an ajax call I'm making. The success always returns an empty string no matter if what the php function returns. It seems that looking in firebug the function is called and I've tested it by sending myself an email. It just happens that it is always an empty string. And I am very confused because I developed it on my local server and it worked just fine.
[Code]...
View 5 Replies
View Related
May 5, 2010
I am running the scripts below which should return a string containing a URL.So far, it cannot find the form contents in Firefox, but displays the non-dynamic data such as ?Location=. It won't work at all in IE.
View 1 Replies
View Related
Jun 25, 2010
Just a quick one here I want a regular expression that tests a string to find out if not empty. I am currently using /^[a-zA-Z0-9]+$/ which allows all alphanumeric characters, however unfortunately does not allow white space. As I am trying to use the RE for a form name input and I don't wish to separate first and last name, I want to allow users to enter their full name including spaces. Can anyone tell me an RE that allows all alphanumeric characters and white space in a string but does not allow an empty string
View 14 Replies
View Related
Sep 30, 2009
I'm using a Javascript gallery (runs on Prototype library) that populates a caption field if the user has entered a caption for an image.
I need a little bit of code to hide the caption's div entirely if the user hasn't entered a caption for a particular image (var 'caption' is empty).
It's the bottom-right white box below the image, you'll have to click over to the second page of the gallery (NEXT) to see an example of an empty one that I want to hide:
[url]
Here's the CSS:
Here's the HTML:
I'm sure this isn't that hard, but I've spent more time trying to get that caption box to hide than setting up the gallery.
View 2 Replies
View Related
Aug 19, 2011
I'm developing a wordpress based site using custom fields. It is basically a database of company sites we serve hosted locally on our systems for our reference only.
The fields are manually inserted into the single.php file which outputs the variables typed into the text box in the "add new post" page.
For example <?php the_field('domain'); ?> outputs the domain such as ds02.jamies.local in plain text.
Here is a small excerpt of the page:
Code:
The div "post3" is basically a big box with a border and background. Inside that is the title for the box, then the php variable enclosed in a div "inside" underneath.
Now in most cases, we do not have all the information. There is around 40 boxes and if only 10 are filled in, its quite a headache scrolling past 30 empty boxes trying to find filled in one.
Is there a way, using simple javascript to simply hide those empty boxes?
My coding is quite poor, but im trying to learn. Ive tried this and it was a partial success on jsfiddle but nothing on the site itself
Code:
View 14 Replies
View Related
Jun 26, 2010
I have a for loop: Code: for( var i = 0; i < aInput.length; i++ ) I want to use this i variable to concatonate it as a string to find an input box
Code:
var j = i;
var qualname = "discountqualifier" + j;
qualname.toString();
if ( inputName == ( qualname ) )
{
Assuming I have a input box named discountqualifier0, discountqualifier1, discountqualifier2 etc...
View 4 Replies
View Related
Aug 12, 2011
Code:I am having problems with the following. I am wanting to hide <tr> in my table (employees) and only show employees that are in the selected department (selected via dropdown box).I need to set a javascript array to a php array. I am looping and assigning the array and am wanting to pass a javascript variable as the index in php array. I have marked my problem lines in red. Thanx for any help.
<script type="text/javascript" >
function display_elements()
{
var departments = new Array;
[code]....
View 1 Replies
View Related
Feb 1, 2011
I have an image that is encoded as a base 64 string, and I'm having trouble passing that a WCF service using $.ajax(). I initally tried using JSON to pass the argument to the web service, but I kept getting 400 Bad Request errors for anything of reasonable length (if I just pass a test string in, it makes it through, of course). I've tried calling encodeURIComponent on the string before stringifying it, but that hasn't helped. I've also tried various content types ("application/json; charset=utf-8", as well as whatever the default is) and that hasn't made a difference either. Unfortunately, the request is being made through a mobile phone, so debugging options are few. Is there an upper limit to the size of the argument that I'm passing in this? The strings can be a few hundred kb at the low end up to maybe 1 or 2 mb at the high end.
Here is a snippet of the code I am using:
$.ajax({
type: "POST",
url: "http://www.myserver.com/MyService.svc/MyFunction",
cache: false,
[Code]....
No matter what the string consists of, it errors would with a 400 Bad Request error. No further information.
View 1 Replies
View Related
Oct 22, 2009
What type of variable is an empty array element? I thought it was undefined, but i noticed that they have different behavior than undefined does:
var r=Array(1);
var s=r.concat([0,"",null,undefined]);
alert (s.toSource()) //==="[, 0, "", null, (void 0)]"
typeof s[0] //==="undefined"
typeof s[4] //==="undefined"
As you can see, 0 and 4 both === undefined. Yet, they don't have the same toSource()...
Is this special type named anything specific? Or more importantly, can it be detected outside of an array as being distinct from undefined? I am thinking this would be the same type as ({}).nonProp ...
I guess the question is actually, "can you tell the difference between uninitialized and undefined"?
View 6 Replies
View Related
Aug 23, 2010
Given the following HTML:
<ul>
<li class="">1</li>
<li>2</li>
<li>3</li>
[Code].....
Unfortunately that doesn't work. I understand that the index() isdocumentation (though confusing) correctly tells you that the above code doesn't work. Maybe I'm just weird, but I feel that the way .index() is implemented for string arguments is very counter intuitive. I have an expectation that .index() is similar to indexOf() in javascript.
View 2 Replies
View Related
Mar 29, 2011
<script>$(document).ready(function(){
$('td img').click(function(){
alert($(this).attr('id'));
});
$.ajax({
[Code]...
I am new to jquery and I was wondering on how to send the id of the image I clicked on to a ajax call.
View 2 Replies
View Related
Dec 3, 2010
function findDivs(id)
{
$('div[id~="' + id + ''"]').innerHTML = "insert this text into div's with id that contains the variable: id";
}
So the selector i am using isn't working. I'm pretty new to jQuery so the selector may be completely off.
View 1 Replies
View Related
Sep 16, 2010
I want to pass a variable between dialogue boxes but can't get it to work:
<script type="text/javascript">
function deleteE(v,m,f){
if(v == true) {
$.prompt('Enquiery Deleted.',{callback: del, buttons: {OK: true}, persistent: true}) ;
[Code].....
I have got the process for removing the record from the database to work fine, it's just getting this value from the first box to the last and into the php file.
View 2 Replies
View Related
Apr 17, 2011
I'm having a tough time trying to add the "zip" variable to my YQL statement.
var zip = $(this).attr('zip');
$.YQL("select * from rss where url='http://weather.yahooapis.com/forecastrss?p=' ' "+ zip +" ' ", function(data){
var w=data.query.results.item;
[Code].....
I've tried as many different ways as I could imagine. Simply putting the literal zip code in the query works perfect.
View 2 Replies
View Related
Aug 15, 2010
if this is such a obvious question, but i'm kind of newbie in JQuery, i am using a lightpop plugin, & i want to pass 'image_path' via html. lightpop plugin code is something like this:
(function(jQuery){
jQuery.browser = jQuery.extend(
{chrome: /chrome/i.test(navigator.userAgent)} ,
jQuery.browser
[Code]...
View 1 Replies
View Related
May 27, 2011
I have a set of select form elements. What I want it to do is this.
when I select 'tiger', then I want it to trigger and update the div 'description.'
How would I go about doing this.. I am relatively new to jQuery.
View 6 Replies
View Related
Jul 20, 2011
Basically I want the field name to be a variable but it is taking it as a literal.When I print back the POST array with PHP I get:- Array ( [field_name] => Whatever I typed )So if the text field has a name of 'username' then I want the PHP to print back
Array ( [username] => Whatever I typed )
$(function(){//on DOM.load
$('.register-field').blur(function() {
var field_val = $(this).val();
[code]....
View 1 Replies
View Related
Dec 31, 2011
I'm trying to pass a var via object to .load() ... .load(URL, {"myname":var}, function) { ... This will not work unless the var is in quotes and therefore not a variable anymore. I want to be able to use a form to feed data to the program that loads the data.
View 8 Replies
View Related
Nov 3, 2009
This is my very first post! so please be kind Ok, i am very novice to jQuery. But what i am trying to do is use the jQuery attribute selector to select an input with a specific name. I can select an input of name type fine by doing the folowing:
[Code]...
View 2 Replies
View Related
Aug 11, 2009
I've used jquery to create a tabbing system and I want to be able to use it on multiple pages. I want to be able to pass a variable containing the number of items in the list from the html to the js file. Inside the js file I have this function:
[Code]...
View 2 Replies
View Related