javascript functio variable not getting sent through?


theres nothgin wrong with my ajax, it works and is sending other variables but whe i want to send "pood" from function farmers(pood, happy) i twill not work. now when i call the function it goes like this onclick="farmers('pisslet', 'popcocky')" now it will not send PISSLET, what do i do
its making me angry this is the querystring the other variables are sending to my ajaz page and i echo them out, but thie pood variable will not work . i even tried redefining it with var gummy = pood;
it comes up blank on the ajax page when echos please help. not to mention i alert(pood) and it says htmltablet something. var queryString = "workingvariable=" + blabbr + "¬workingvariable =" + pood;
Posted On: Sunday 25th of November 2012 09:20:18 PM Total Views:  401
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




jQuery IF function

I have a basic idead of jQuery and can do some basic stuff, but I can't figure out how to do the following: I need jQuery to do the following function when you SELECT an option from a form Dropdown selection... When a person selects PS3 in drop down it will hide all DIVs with the class of .container that do not have the class .ps3 in it. How can I do this
VIEWS ON THIS POST

139

Posted on:

Sunday 25th November 2012
View Replies!

Need help with 2 JQuery functions

I have a form with a text input where I am trying to use 2 jquery functions together. However only one of them seems to work. So I am hoping their might be a jquery guru out there that can help What I have is a text input box called nickname and also has a id of nickname What I am doing is when the user types in a nickname into the field I am checking my mysql database to ensure the nickname is available or not. However I also need this text input box to not allow/accept any spaces which I am trying to do by preventing the spacebar Here is my code /*prevent spacekey from putting a space in the text input box that has the id of nickname */ $(#nickname").keyup(function(){ str = $(this).val() str = str.replace(/\s/g,'') $(this).val(str) }); /*below is the code which currently works fine for cheacking the avail of a nickname as its typed*/ pic1 = new Image(16, 16); pic1.src = "graphics/loader.gif"; $(document).ready(function(){ $("#nickname").change(function() { var usr = $("#nickname").val(); if(usr.length >= 3) { $("#status").html('Checking availability...'); $.ajax({ type: "POST", url: "http://www.******.***/inc/check_nickname.inc.php", data: "nickname="+ usr, success: function(msg){ $("#status").ajaxComplete(function(event, request, settings){ if(msg == 'OK') { $("#nickname").removeClass('object_error'); // if necessary $("#nickname").addClass("object_ok"); $(this).html(' Available '); } else { $("#nickname").removeClass('object_ok'); // if necessary $("#nickname").addClass("object_error"); $(this).html(msg); } }); } }); } else { $("#status").html('nickname has to be 3 characters or more.'); $("#nickname").removeClass('object_ok'); // if necessary $("#nickname").addClass("object_error"); } }); }); //--> Here is my form field code Nickname:
VIEWS ON THIS POST

155

Posted on:

Sunday 25th November 2012
View Replies!

2 js conflicting? I have two js that functions that?

http://bearpaw.emeraldcode.com/news/lookbook I have a scrolling js called jBond Slider that moves when you click and drag. And I am also using prettyPhoto when they are click to open in a "pop up" window. This is copied over from an older site using lightbox: http://bearpawshoes.com/lookbook.shtml My issue is when you scroll, it registers it as a click also and will open the link when you are just moving the slider. If you view the 2nd link I provided this is what I want it to look like. I need to use prettyPhoto because there are times when I use it to open another webpage instead of just a photo in which case lightbox would work. Is there a way to tell the page to first use jbond slider and when it is stopped use PrettyPhoto If I remove the prettyPhoto reference it works like I want it to also so it has to be some conflict with that. see here:http://bearpaw.emeraldcode.com/news/press Please help!
VIEWS ON THIS POST

214

Posted on:

Sunday 25th November 2012
View Replies!

Split function and looping through predefined class?

, I was wondering what the string.split() does. And another question is that I want to loop through the class like Math and find out what functions are defined in it.But, I was not too sure how to that. I tried a couple of things but they unfortunately didn't work. Thank you..
VIEWS ON THIS POST

166

Posted on:

Sunday 25th November 2012
View Replies!

Got problem in the onchange function

There is one table that have fields included the add row button. I am using onchange event to call data from other tables, so when I select an option in the option box can automatically get the value that has been selected earlier (do not need input the value manually). Then I add row in the same table and after that I select one option back in the box option and get different values \tfrom the first, the problem is the values \tobtained appear in the first box, not in the second box. For the html example: No Name Class Point Action 1  
VIEWS ON THIS POST

215

Posted on:

Sunday 25th November 2012
View Replies!

Javascript function timing issues

all, afetr receiving such excellent help regarding my first ajax file, i have received an error in my code that i have not encountered before. I have created a form with input fields and when the button is clicked, three functions are run, the first is an ajax call to a php file that creates and populates a table based on values from the database, the second executes the calculation function, the third takes the calculation results and inserts them into the table created from the ajax call. After all my tests, i found the error lies in the calculation.js file, the following code works; function multiply() { document.getElementById("A").value = (calculation) ; document.getElementById("B").value = (another_calculation) ; document.getElementById("C").value = (another_calculation) ; document.getElementById("D").value = (another_calculation) ; alert("Calculation done"); } //POPULATE ORDER TABLE WITH RECOMMENDED VALUES function fillOrder() { document.getElementById("A_order").value = document.getElementById("A").value; document.getElementById("B_order").value = document.getElementById("B").value; document.getElementById("C_order").value = document.getElementById("C").value; document.getElementById("D_order").value = document.getElementById("D").value; alert("Orders values added"); } However, when i remove the alerts, i get an error in the javascript saying antibody_order is null.
VIEWS ON THIS POST

133

Posted on:

Sunday 25th November 2012
View Replies!

javascript function onClick issue

all. I am trying to get a function call from an onclick used in a html form it looks like this. function work(strVal) { alert(strVal); return 1; } and this I don't know javascript very well but i do know java, and this should work with a string. When i use the work() function in a onclick it only works with an integer. If i use it anywhere else i can use and integer or string. so if i do this it will cause a pop up alert that shows the integer correctly If i do this it will not pop up 'word' Is there something about an onclick that limits the use of a string in the functions arguement. this function works with a string if i call it from somewhere else, it just doesnt work in onclick . I have not clue
VIEWS ON THIS POST

178

Posted on:

Sunday 25th November 2012
View Replies!

window.onload function

hey , I have a problem here. I wish to generate 1 pop out date function. below is my code of javascript..but still I cant get any pop out after I click my textfield..guidance needed...ty window.onload = function(){ new JsDatePick.({ useMode:2, target:"dateStartAppraisal", dateFormat:"%Y-%m-%d" }); };
VIEWS ON THIS POST

311

Posted on:

Sunday 25th November 2012
View Replies!

not able to execute function in javascript

My problem is that I am trying to execute a function on button click event but it just shows not even for a sec it just flashes. html & Javascript : function createLabel(){ /*Get UserName*/ var unString = document.createElement("label"); unString.className = "userName"; var uName = document.getElementById("username").innerHTML; unString.innerHTML = "By " + uName + ""; /*Get UserName*/ /*Get PostString*/ var postString = document.createElement("label"); var postText = document.getElementById("poster").value; postString.className = "postText"; postString.innerHTML = "\n\n" + postText; postString.style.display = "block"; /*Get PostString*/ var hr = document.createElement("hr"); var tr = document.createElement("tr"); var td = document.createElement("td"); tr.className="postTR"; td.className = "postTD"; td.appendChild(unString); td.appendChild(postString); td.appendChild(td); tr.appendChild(hr); document.getElementById("postTable").appendChild(tr); }
VIEWS ON THIS POST

120

Posted on:

Sunday 25th November 2012
View Replies!

click function not working

why isn't this working $('body').find(".overcolor").click(function(){ alert("hi"); });
VIEWS ON THIS POST

275

Posted on:

Sunday 25th November 2012
View Replies!

My function don't work after ajax post

Have a interesting problem. I make a little ajax mechanism to get info from php file and add a function for delete the data. phpfile.php: js file: function getdatafromfile(){ var bu = 'bu'; $.ajax({ type: 'POST', url: 'phpfile.php', data: {bu: bu}, success: function(msg){ $("#msg").html(msg); getContent(); } }); } function something(){ alert("alert"); } Data from the php file is fine, but when I click on the link (alert) getted from ajax, function don't work. How to fix that
VIEWS ON THIS POST

250

Posted on:

Sunday 25th November 2012
View Replies!

Help with functioning Javascript

I'm looking for someone who knows Javascript well. I've posted on other forums and it appears that no one is able to help me with getting a script to work on my page., Well, no one here can see over your shoulder, so post the script (or fragments) and a detailed question about what you are having trouble with and perhaps some of the JS gurus can give you some suggestions.
VIEWS ON THIS POST

114

Posted on:

Sunday 25th November 2012
View Replies!

daysTill function

First let me introduce myself as Miss Beginner of all time!...I recently took upon myself to give myself a challenge and take a beginner's javascript course...in my first assignment i have to display certain scripts...i have accomplished everything so far except on my second page i would like to have the "daysTill()" to display where i wrote the text in my document...i would be so ever grateful if someone could help me out....here is my complete 2 pages of scripts and i have bolded and change the color of where i mean exactly: by Martine Couture This page requires Javascript Did you know there are...days left before the end of the Javascript course Did my page meet all expected Javascript Yes! Almost! Hoping you enjoyed my last assignment...javascript is a struggle!
VIEWS ON THIS POST

217

Posted on:

Sunday 25th November 2012
View Replies!

cannot pass string to javascript function from Ajax

I am using ajax to pass php variable to javasccript function as shown below for my particular application. i am using the foolowing function from ajax.js freely available from net to implement the ajax functionality as var abc = new sack(); PHP portion which passes the response text: ************************************ javascript: ********* showfield(ss) { alert(ss); } Problem: ******* 1] When $table is having a string with only numeric characters for eg: "123" we get the alert 2] When $table is having a string with alphanumeric characters for eg: "123efg" we get the error report as "missing ) after argument list" 3] When $table is having a string with alphanumeric characters for eg: "efg123" or "abcdfr" we get the error report as "efg123 is not defined" or "abcdfr is not defined"., You need to pass strings with double or single quotes so you should use the escape character try echo "show";, Really a Great solution
VIEWS ON THIS POST

221

Posted on:

Sunday 25th November 2012
View Replies!

javascript function to write to a input text box

: I have two input boxes on a form which receive the first and last name of a user. I want to be able to use charAt() to get the first letter in each box and pass it a third box on the same form. is this doable May I request some help I was thinking something like the function below would be the starting point --I stand correct, as it is not working. var str=\"Mossa\"; document.write(''); var str=\"Barandao\"; document.write(''); Any thoughts! Mossa
VIEWS ON THIS POST

137

Posted on:

Sunday 25th November 2012
View Replies!

Getting return value from post anonymous function

Hi . I have been struggling with a form wizard all day. I'm using jquery stepy (form wizard) along with validation plugin. To cut a long story short, my first step is to get MySQL connection from form controls details. On submit ('next' button) a check is made on an empty hidden control ('hid'). rules: { hid: { required: function(){ return checkDBData(); }, messages: { hid: {required: 'SQL not available'}, ...(etc)... So, if the function checkDBData passes, false should be returned, so that the form can progress to the next step. If the connection details fail, true is returned so that an error msg is posted. Here's the checkDBData function: function checkDBData(){ var host = $('#mysql_host').val(); var username = $('#username').val(); var password = $('#password').val(); var dbname = $('#dbname').val(); $.post( "install/sqlcheck.php", {"host": host,"username": username, "password": password, "dbname": dbname}, function(msg){ if(msg.required == false){ return false; }else{ return true; } }, "json" ); } the return values don't find their way back to the rules. However, if I hard code false and true to the function... function checkDBData(){ var host = $('#mysql_host').val(); var username = $('#username').val(); var password = $('#password').val(); var dbname = $('#dbname').val(); $.post( "install/sqlcheck.php", {"host": host,"username": username, "password": password, "dbname": dbname}, function(msg){ if(msg.required == false){ return false; }else{ return true; } }, "json" ); return false; //or return true for testing purposes } This works. I assume it's due to the asynchronous nature of the ajax call. Any ideas
VIEWS ON THIS POST

141

Posted on:

Sunday 25th November 2012
View Replies!

javascript error :function callAjax undefined in firefox

I am calling the callAjax function in the HTML body as below : Request Tracking System Requests for me Requests
VIEWS ON THIS POST

201

Posted on:

Sunday 25th November 2012
View Replies!

How can I apply this function to an input ?

See my demo page for where I have it working on an img src but not an input which is what I really want. Here's the link to my testing / demo page: http://www.myu2sig.com/stellardonations/buttontype.php As for what I want to do, how can I apply the function to the input so it's image changes on the value of the select like the regular image does which uses HTML's img src. As for all of the code that produces what you see on said page: function showimage(t){ if (!document.images) return; document.images[t.getAttribute("name").replace("select","pics")].src=t.options[t.selectedIndex].value } Regular Image using: < img name="firstpics" src="/stellardonations/paypaldonate.gif" > Input Image using: < input name="firstpics" type="image" src="/stellardonations/paypaldonate.gif" border="0" name="submit" > Yes No No = Donate Yes = Subscribe
VIEWS ON THIS POST

154

Posted on:

Sunday 25th November 2012
View Replies!

Javascript function not firing

I'm having problems with a JavaScript function not firing and I can't figure out why not. I'm opening a pop-up window which needs to pass some variables back to the opening window. I've used this code elsewhere with no problems and I've copied it and changed some of the details and now it doesn't work. It's probably going to turn out to be something so stupid but I just can't see it. Pop-up window code: function sendValue (employerseq,employercode,employername) { var selvaluea = employerseq.value; var selvalueb = employercode.value; var selvaluec = employername.value; window.opener.myfunc(selvaluea,selvalueb,selvaluec); window.close(); } Using alerts I can see that the correct variables have been passed into the funcion and are being assigned correctly. It doesn't seem to want to trigger the function in the opener window myfunc. Opening Window code: function myfunc(employerseq,employercode,employername) { alert('in my function'); window.document.getElementById('employer_seq').value = employerseq.value; window.document.getElementById('employer_code').value = employercode.value; window.document.getElementById('employer_name').value = employername.value; } It doesn't even trigger the first alert instruction in the function. Can anybody see what the problem is
VIEWS ON THIS POST

136

Posted on:

Sunday 25th November 2012
View Replies!

javascript for loop breaking out of function

I have a javascript test function to determine if items have been entered but it appears that the function never completes, it runs the for loop but not the items after it\t I can produce a screen capture video of the events that happen, contact me and I will send a link to my download area. of the code outside of the for loop (the last 5 lines) does not get executed\t here is the function that is triggered by a mouseover: [icode=javascript] function testChecked(form) { var noneselected = 0; var errmsg = ''; var iserror = 0; var formcount = document.forms.length; alert('initial form length:' + formcount); for ( var cntr = 0; cntr
VIEWS ON THIS POST

302

Posted on:

Sunday 25th November 2012
View Replies!