Jump to content

Wayniac

Members
  • Posts

    89
  • Joined

  • Last visited

    Never

Everything posted by Wayniac

  1. I problem I am having is when the pop up message appears saying "Example Text". I have to click it twice for it to go away. The first time I click it, that activates the button to go to the URL stated. The second click just makes it go away. How do I merge these together so when I click "Ok", it simply goes to the specified URL? Thank you <script type="text/javascript"> function message() { if (message != 2) { alert("Example Text") } } </script> <a href="javascript:message();"><input type="image" name="submit" border="0" src="http://www.example.com/buynow.png" alt="PayPal - The safer, easier way to pay online"></a>
  2. Made that change, but still not working. (Thank you for the heads up though )
  3. Thank you everyone for replying. Preston, this worked very well and appreciate your assistance. Its still not quite working, but is almost there. Below is my full code (shortened down). The selection for united states works well. Although I may have my brackets in the wrong placement. There the last two at the bottom. Only reason I say this is because the contents inside the main IF statement are not working. Any ideas? <script type="text/javascript"> //var ship_country = document.getElementById("ship_country").value; //function calc() { //if (document.getElementById("ship_country").value = ("United States") { //function calc(sel) { //if ( sel.value == "United States" ) { function calc() { if (document.getElementById('ship_country').value == 'United States') { //alert('US Selection works'); function roundNumber(rnum, rlength) { // Arguments: number to round, number of decimal places var v1 = document.getElementById("combo_1").value, v2 = document.getElementById("combo_0").value; var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength); var newnumber2 = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength); document.price.sub_total.value = newnumber.toFixed(2); // Output the result to the form field document.price.amount.value = (newnumber2 / v1).toFixed(2); } window.onload = function() { var dropChange = function() { // Declaring variables var v1 = document.getElementById("combo_1").value, v2 = document.getElementById("combo_0").value; var amount3 = document.getElementById("txt_price3").value, amount = document.getElementById("txt_price").value; document.getElementById("txt_price3").value = (amount); document.getElementById("quantity").value = (v1); if (v2 == 1) { document.getElementById("state").value = ("AL"); } else if (v2 == 2) { document.getElementById("state").value = ("AK"); } else if (v2 != (60 || 61 || 62 || 63 || 64 || 65 || 70)) { if (v1 == 1) { document.getElementById("txt_price2").value = v1 * 24.95 + 14.70; } else if (v1 == 2) { document.getElementById("txt_price2").value = v1 * 24.95 + 15.10; } } }; document.getElementById("combo_0").onchange = dropChange; document.getElementById("combo_1").onchange = dropChange; }; } } </script>
  4. I'm attempting to have the example code section which is currently commented out to keep from code spamming this forum to react with the IF statement created within the FUNCTION that I called "calc". The code in the example section does work, however the FUNCTION or IF statement is not working. Could anyone help me visualize the problem. Thank you <select name="ship_country" id="ship_country" style="min-width:200px;" onclick="calc;"> <option value="" selected="selected"></option> <option value="United States">United States</option> <option value="Canada">Canada</option> </select> <script type="text/javascript"> function calc() { if (document.getElementById("ship_country").value = ("United States") { // Example comment representing a lot nonsequential code pertaining to this topic. } } </script>
  5. Reply to jcbones: No file is created, however the I also have text accompanied by the image upload and that passed through okay. base64 is all I am familiar with, do you have another option? Thank you Reply to jd307: The file has not been physically uploaded, only the text accompanied in the POST. No file anywhere to be found... Anything to help me fix this issue, thank you
  6. In the code below, the error report I keep getting specfies an issue with ($newname = base64_encode(file_get_contents("./upload/$newname")) this line of code, you will find it below aswell. I'm trying to upload an image to a folder called "upload". Here is the error report: Warning: file_get_contents(/upload/image_4c06ab5811896.jpg) [function.file-get-contents]: failed to open stream: No such file or directory in /mnt/w0712/d16/s01/b02c73a9/www/lifelikemedia.ca/wtt/crm/struggle_add_admin.php on line 69 It seems to be a directory or file that is not being seen or not even there. I checked the "upload" folder for which I created and the permissions are set to "777", so full access is allowed. The directory that my page is in is /crm/ and my upload folder is located in /crm/upload/ I checked to make sure there were no spelling issues or case-sensitive issues. Don't make any sense to me.... Can anyone else brighten my day? if ($_REQUEST[completed] == 1) { $newname = uniqid("image_").".jpg"; // Get the details of the image list($size, $width, $height, $type, $html_string, $mime) = getimagesize($_FILES['imagefile']['tmp_name']); move_uploaded_file($_FILES['imagefile']['tmp_name'],"./upload/$newname"); $tmpName = $_FILES['userfile']['tmp_name']; if(isset($_POST['submit'])) { $newname = base64_encode(file_get_contents("./upload/$newname")); $fname = mysql_real_escape_string(stripslashes($_POST['fname'])); $lname = mysql_real_escape_string(stripslashes($_POST['lname'])); $phone = mysql_real_escape_string(stripslashes($_POST['phone'])); $phone_msg = mysql_real_escape_string(stripslashes($_POST['phone_msg'])); $rname = mysql_real_escape_string(stripslashes($_POST['rname'])); $location = mysql_real_escape_string(stripslashes($_POST['location'])); $notes = mysql_real_escape_string(stripslashes($_POST['notes'])); $ship_date = mysql_real_escape_string(stripslashes($_POST['ship_date']));
  7. Huh... That would explain a lot of my problems... Nothing at all is able to be edited... It seems nothing is will change so therefore is not being send from the database from the main_edit_admin.php. I compared it to my previous pages which work fine, it must be a syntax error... Could someone take a peek and see if they see any discrepencies? A second set of eyes could go a long ways since mine seems to read in a trance after the 6th pass...
  8. Hmmmm.... The array is working quite well now, but I can't seem to change the values. If I wish to edit a country and change it from United States to Canada, once I submit and go check, nothing has changed... Something is not getting accepted... <select name="bill_country" class="textBox_center" id="bill_country" style="min-width:200px;" value="<?php $options = array("United States","Canada","United Kingdom"); foreach($options As $bill_country){ echo("<option name=\"bill_country\" value=\"\".$bill_country.\"\""); if($bill_country == $row["bill_country"]){ echo(" selected=selected"); } echo(">".$bill_country."</option>\n"); } ?>"/>
  9. I believe I might have it (thanks to you), I'll keep you updated with the progress, just trying to get it to keep its selection now. I placed it within the value of selection.
  10. I placed it within php tags but all I get is a print out of "United States", "Canada", and "United Kingdom"... Their not in any selection box... $options = array("United States","Canada","United Kingdom"); foreach($options As $bill_country){ echo("<option name=\"bill_country\" value=\"\".$bill_country.\"\""); if($bill_country == $row["bill_country"]){ echo(" selected=selected"); } echo(">".$bill_country."</option>\n"); }
  11. Thank you very much for your post and my apologize for my lack in understanding what it is you exactly mean... I think I understand, but am uncertain of how to implement this change...
  12. The forum format options are cutting it off at the end and not applying the second tags around them properly.. weird... Thats why its cut off
  13. That worked perfectly, thank you very much.
  14. I tried this, but then all my JS code stopped working... clearly I made a mistake... Any suggestions for my syntax? document.getElementById("total").value = parseFloat(“_sub_total + _tax + _sh”);
  15. The problem that I am having is in the field "total", its spitting out "40.3180.4". Where it should be 117.95, below are my calculations. quantity(10) * price(10) = subtotal(100) subtotal(100) * 0.0795 = tax(7.95) subtotal(100) * 0.1 = s&h(10) subtotal(100) + tax(7.95) + s&h(10) = total(117.95) <!-- Field Calculations --> <script> function f_sub_total(){ // Calculating Subtotal var _quantity = document.getElementById("quantity").value; if(!_quantity){ var _quantity = 0; } var _price = document.getElementById("price").value; if(!_price){ var _price = 0; } document.getElementById("sub_total").value = _quantity * _price; // Declare Local Variables var _sub_total = document.getElementById("sub_total").value; // Calculating Tax document.getElementById("tax").value = _sub_total * 0.0795; // Calculating S&H document.getElementById("sh").value = _sub_total * 0.1; // Declare Local Variables var _tax = document.getElementById("tax").value; var _sh = document.getElementById("sh").value; // Calculating Total document.getElementById("total").value = _sub_total + _tax + _sh; } </script> This is the Total outcome I get. Its adding the variables like strings. 100 + 7.95 + 10 Total: 1007.9510 PS: If you change the "+" signs to "*", they will multiply perfectly.
  16. Thank you so much havenpets! I got your code working, the issue I was having was putting the Javascript within the form. I placed it outside and worked marvously. Once again, thank you so much
  17. Yes your right. You can't imagine how much I appreciate you going through the effort to do that for me. I will keep this forum updated when I figure out what my mistake is.
  18. Thank you heaven, unfortunately I could'nt get that to work either. Should I be putting the script in the header? Everything seems like it should work but nothing at all is happening...
  19. Thank you both for your replies. havenpets, I tried that code but nothing worked, I even tried changing it to an onClick, but no go...
  20. Sorry Dom, not sure I follow on the first part.
  21. I am trying to get the quantity to multiply with the price and to equal the sub_total. The problem is getting it to instantly calculate with the field. So as soon as the user enters in the price and quantity, I want the sub_total to instantantly calculate. I was thinking of setting up a function and an onClick for the sub_total. I just can't seem to get it to work, nothing is changing so I am clearly missing a step. $quantity = mysql_real_escape_string(stripslashes($_POST['quantity'])); $price = mysql_real_escape_string(stripslashes($_POST['price'])); $sub_total = mysql_real_escape_string(stripslashes($_POST['sub_total'])); I placed these quick variables in to see if the fields would even accept any values. $price = 2.99; $quantity = 100; $sub_total = $quantity * $price; Here are the fields... <input name="quantity" id="quantity" size="35" maxlength="255" /> <input name="price" id="price" size="35" maxlength="255" /> <input name="sub_total" id="sub_total" size="35" maxlength="255" /> Any suggestions would be greatly appreciated...
  22. Thank you taquitosensei, sorry for the late reply. Had a serious case of no internet for a while due to some unfortunate circumstance. You last entry fixed the issue, thank you so much
  23. Thank you Taq, that helped with the cleanup... Your right, its still going to have the same issue with getting the quotations or brackets in the Javascript... I now have a Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
  24. I'm having a syntax error and can't seem to track it down... The problem lies somehwere in between "<a href=\"javascript:confirmDelete('main_delete_admin.php?spreadsheetid=$myrow" . "$spreadsheetid" . $row["spreadsheetid"]') . \">" . "<span class=\"text_bold\">" . "Delete " . "</a>" Here is the full code for this section... echo("<td>" . "<a href=\"main_more.php?spreadsheetid=" . "$spreadsheetid" . $row["spreadsheetid"] . "\">" . "<span class=\"text_bold\">" . "Read" . "</span>" . "</a>" . "<span class=\"text_bold\">" . " || " . "<a href=\"main_edit_admin.php?spreadsheetid=$myrow" . "$spreadsheetid" . $row["spreadsheetid"] . "\">" . "<span class=\"text_bold\">" . "Edit" . "</a>" . "</span>" . "<span class=\"text_bold\">" . " || " . "</a>" . "</span>" . "<a href=\"javascript:confirmDelete('main_delete_admin.php?spreadsheetid=$myrow" . "$spreadsheetid" . $row["spreadsheetid"]') . \">" . "<span class=\"text_bold\">" . "Delete " . "</a>" . "<br>" . "</span>" . "</td>"); Thank you
×
×
  • 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.