Jump to content

bcode

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male

bcode's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Got it to work here is the js $(document).ready(function(){ $("#response").css("display", "none"); $("#response").load("main.php"); $("#response").fadeIn(5000); $("#home").click(function(){ $("#response").fadeOut(5000, function(){ $("#response").fadeIn(5000).load("main.php"); }); }); $("#about").click(function(){ $("#response").fadeOut(5000, function(){ $("#response").fadeIn(5000).load("about.php"); }); }); $("#contact").click(function(){ $("#response").fadeOut(5000, function(){ $("#response").fadeIn(5000).load("contact.php"); }); }); });
  2. Here is my Javascript that isn't working the way I would expect I am not very fluent with javascript. Wondering where I am going wrong with it you can see the problem on this page http://gen-fan.com/AA_blackreel/index.php it isn't loading back up after the click. What am I doing wrong am I using the functions incorrectly? $(document).ready(function(){ $("#response").css("display", "none"); $("#response").load("main.php"); $("#response").fadeIn(5000); $("#home").click(function(){ $("#response").fadeOut(5000); $("#response").delay(5000).load("main.php", function(){ $("#response").fadeIn(5000); }); }); $("#about").click(function(){ $("#response").fadeOut(5000); $("#response").delay(5000).load("about.php", function(){ $("#response").fadeIn(5000); }); }); $("#contact").click(function(){ $("#response").fadeOut(5000); $("#response").delay(5000).load("contact.php", function(){ $("#response").fadeIn(5000); }); }); });
  3. I have a form that is served up using the facebox plugin when I goto post using the form plugin jquery it doesn't work. It works fine when not using the facebox plugin the form posts fine via the form plugin. Any ideas for me to try would be much appreciated. I am new to Ajax and Jquery if you need more info let me know. Sorry if this is Gibberish I am tired and have been pulling my hair out over this. Thanks
  4. I am getting Warning:mysql_fetch_assoc():supplied argument is not valid. I am confused because I double checked the table names and made sure the rows were correct but can't get it to work. if(!empty($_POST['password'])) { $userName = $_POST['name']; $password = $_POST['password']; $userNameClean = mysql_real_escape_string($userName); $passwordClean = mysql_real_escape_string($password); $userIP = $_SERVER['REMOTE_ADDR']; $sql = "SELECT * FROM usersTable WHERE userName='$userNameClean' AND userPassword='$passwordClean'"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); $id = $row['id']; if($id > 0) { $set = "UPDATE usersTable SET userActivity = 'online', userIP = '$userIP' "; $set .= "WHERE id = '$id'"; mysql_query($set); header('Location: index.php'); }else{ $loginstatus = 'Invalid email and/or password.'; } }
  5. Thank you for the single quotes I can't believe that was what I was missing I was pulling my hair out over this.
  6. I can't get this to work I don't know what is wrong I have checked the table names and checked everything with print_r and the Mysql statement is printing right but to no avail. $names = explode(" ",$searchTerm); $datauser = "SELECT * "; $datauser .= "FROM users "; $datauser .= "WHERE firstName = $names[0] AND lastName = $names[1] "; $resultuser = mysql_query($datauser); $listuser = mysql_fetch_assoc($resultuser); $contractUser = $listuser['contract'];
  7. Thanks that worked for me too. Man I was staring at that for awhile needed some outside advice awesome Thanks again.
  8. Yeah sorry I was copying those around to show what I have tried but it doesnt work with it being preselectSecond either.
  9. My problem is I can get the country to preselect based on what is outputted from the server but can't get the state or city to work? I have tried default value but it doesnt read the VAR selectedS for the state also I tried preselecting the state with the Var like I did with the country and not working either. Also I hope I didnt post in the wrong forum I didnt think this was an ajax problem. Sorry if this is confusing I am confused myself I am not that good with Javascript <script type="text/javascript"> var selected = "<?php echo $selectedcountry; ?>"; var selectedS = "<?php echo $selectedstate; ?>"; var selectedC = "<?php echo $selectedcity; ?>"; $(document).ready(function(){ var countryoptions = { "United States" : { "key" : 'United States', "defaultvalue" : "selectedS", "values" : { "Alabama": 'AL', } }, "Mexico" : { "key" : 'Mexico', "defaultvalue" : "selectedS", "values" : { "Baja California": 'Baja CA', } } }; var options = { preselectFirst: selected, preselectFirst: selectedS, emptyOption: true }; $('#country').doubleSelect('state', countryoptions, options); var selectoptions = { "Alabama": { "key" : 'AL', "defaultvalue" : selectedC, "values" : { "Birmingham": 'Birmingham', } }, "Baja California": { "key" : 'Baja CA', "values" : { "Tijuana": 'Tijauna', "Tecate": 'Tecate', } } }; $('#state').doubleSelect('city', selectoptions, options); }) </script>
  10. Awesome i did not know that thank you i just changed the name and it worked i was looking at it for so long thinking I miss spelled a word.
  11. It is giving me an Error in your SQL syntax near 'float,rentprice) Values (' but I can't see where the problem is $sql = "INSERT INTO Listings "; $sql .= "(propName, price, description, type, city, state, image1, authorized,country, address, zipcode, featured, ownerID,ownerEmail,bedrooms,bathrooms,resortName,deed,cc4digit,ccexp,unitNum,float,rentprice)"; $sql .= " VALUES ('$propName','$price','$description','$type','$city','$state','$imagepath','no','$country','$address','$zipcode','$featured','$ownerid','$email','$bed','$bath','$resortname','$deed','$CC4','$CCX','$unit','$float','$rentalprice')";
  12. bcode

    onkey help

    here is a working sample http://code2pixels.com/testzip.html i need to be able to go backspaces
  13. I am completely new to javascript but I am trying it works semi-good I added onKeyUp to my forms input and it works. I now need it when you press backspace to go delete and go to the previous input but I have onkeyup I started trying to get it to work with the second script in the code but I don't really know what I am doing. If you need more info let me know I really don't know how to ask this thank you for any help <script type="text/javascript"> var active_color = '#993300'; var inactive_color = '#993300'; window.onload = formDefaultValues; function formDefaultValues() { var fields = getElementsByClassName(document, "input", "default-value"); if (!fields) { return; } var default_values = new Array(); for (var i = 0; i < fields.length; i++) { fields[i].style.color = inactive_color; if (!default_values[fields[i].id]) { default_values[fields[i].id] = fields[i].value; } fields[i].onfocus = function() { if (this.value == default_values[this.id]) { this.value = ''; this.style.color = active_color; } this.onblur = function() { if (this.value == '') { this.style.color = inactive_color; this.value = default_values[this.id]; } } } } } function getElementsByClassName(oElm, strTagName, strClassName){ var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); strClassName = strClassName.replace(/\-/g, "\\-"); var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)"); var oElement; for (var i = 0; i < arrElements.length; i++) { oElement = arrElements[i]; if (oRegExp.test(oElement.className)) { arrReturnElements.push(oElement); } } return (arrReturnElements); } </script> <script type='text/javascript'> var n=0 function x(){ if(event.keyCode==35){ n+=1 if (n==2)alert('2 x #') } } </script> <form action="" method="get"> <input id="1" name="zipcode1" onKeyUp="document.getElementById('2').focus()" onkeypress='x(event)' type="text" value="?" size="1" maxlength="1" class="default-value" /> <input id="2" name="zipcode2" onKeyUp="document.getElementById('3').focus()" onkeypress='x(event)' type="text" value="0" size="1" maxlength="1" class="default-value" /> <input id="3" name="zipcode3" onKeyUp="document.getElementById('4').focus()" type="text" value="0" size="1" maxlength="1" class="default-value" /> <input id="4" name="zipcode4" onKeyUp="document.getElementById('5').focus()" type="text" value="0" size="1" maxlength="1" class="default-value" /> <input id="5" name="zipcode5" type="text" value="0" size="1" maxlength="1" class="default-value" /> </form>
  14. the for loop is looping through and then for each of the types the number gets added on because that is how the restaurants are categorized so lets say type = chinese type_id = 41 then the restaurant is name = peking wok type = 41 so then the restaurant is put in the chinese category but when the categories are spit out they come in as numerical order instead of alphabetical. The restaurants come in ok no problem there but this guy decided to do things where the category is dependant on the type_id for its order placement which isnt very fun
  15. if(isset($POST[area1]){ run code here }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.