-
A problem with the JavaScript code on my website
Great. Thank you!
-
A problem with the JavaScript code on my website
Hi, I have a problem with the JavaScript code on my website. I'm talking about the words, price and days calculator at the bottom of page (below the table). The problem is that when I'm selecting the word count in the rows of the table, it doesn't affect the number of words, price and days in the calculator immediately, but only after that I'm typing on another field. Here is the code of the calculator: function costTimeCalculator(totalwords) { var cost=totalwords*0.015; cost=cost.toFixed(2); var time=2; if(totalwords>5000) { time=Math.ceil((totalwords/2500)); //if((totalwords%2500)==0) // time=time-1; } if(totalwords>0) { $('#words').text(CommaFormatted(totalwords)+" Words"); $('#cost').text("$"+cost); $('#time').text("~"+time+" Days"); //assign to hidden variables $('#words_value').val(totalwords); $('#cost_value').val(cost); $('#time_value').val(time); } else { $('#words').text('0 Words'); $('#cost').text('$0'); $('#time').text('0 Days'); //assign to hidden variables $('#words_value').val(''); $('#cost_value').val(''); $('#time_value').val(''); } } How can I make that the calculator will be updated immediately after that I'm selecting the word count in the table (without having to type on another field)? Thanks, Steve
-
Backslashes in a form
OK I managed to remove the backslashes by adding: $articleDetails = stripslashes_deep($articleDetails); But I still have a problem with " (double quote). There are no backslashes, but anything after the " (double quote) is being removed. In order to see that you can type: Article number "one" in the subject field in the order page: yeparticles .com/order then click 'continue', and then click 'edit' in the Shopping Cart. I don't have any problem with ' (single-quote) and \ (backslash). Thanks!!
-
Backslashes in a form
Here is the code of the form(articlekeyword): <input type="text" style="width: 300px;" class="kname" name="articlekeyword[]" id="articlekeyword<?php echo $i + 1; ?>" /> But how can I apply the function to each individual element in the array? I tried to use array_map as webdesigner93 suggested but I got this error:
-
Backslashes in a form
I'm having the same problem as when I tried to add: $articleDetails['articlenames'] = stripslashes($_POST['articlename']); $articleDetails['articlekeywords'] = stripslashes($_POST['articlekeyword']); The text in the line is replaced with 'A':
-
Backslashes in a form
What do you mean apply stripslashes to each element in those arrays individually?
-
Backslashes in a form
Hi, I have a problem with the form on my website here: yeparticles .com/order The problem is that all ' (single-quote), " (double quote) and \ (backslash) are escaped with a backslash automatically. I turned off magic_quotes in php .ini, but the problem is still there (I used phpinfo to check that magic_quotes are really off). So I used stripslashes() in the code that pass the values into the database: $articleDetails['comments'] = stripslashes($_POST['comments']); $articleDetails['articlenames'] = stripslashes($_POST['articlename']); $articleDetails['articlekeywords'] = stripslashes($_POST['articlekeyword']); The problem is that it works only for the "General Guidelines for All Articles" textarea ('comments') and not for the 2 other fields: "Subject" + "Keywords/Comments" ('articlenames' + 'articlekeywords') In order to see that, you can fill in this page an email address + subject+words for one article, then click 'continue', and then click 'edit' in the Shopping Cart. Thanks, Steve
-
-
A PHP problem in my site
Great! Thank you.
-
A PHP problem in my site
Hi, I have a problem with my site: articles4less. com/order In order to see what I'm talking about, please fill in this page an email address + general guidelines for all articles + subject+words for one article, then click 'continue', and then click 'edit' in the Shopping Cart. You will see that all the details are there, except of the 'General Guidelines for All Articles' field (textarea). Why is that? Here are the code of this field: <textarea id="comments" name="comments" value="<?php if (isset($articleDetails['comments']) && $articleDetails['comments'] != NULL) echo $articleDetails['comments']; ?>"/></textarea> For comparison, here is the code of the email field: <input type="text" id="email" name="email" class="mywidth" value="<?php if (isset($articleDetails['email']) && $articleDetails['email'] != NULL) echo $articleDetails['email']; ?>"> Thanks, Steve
-
HTML Form
Hi, I'm trying to create a form with two boxes for an insurance site. I want that in the first box the user will select the type of insurance and in the second box type the zip code. For every insurance type, the surfer will be directed to a different URL. This is the code that I have, but of course that it doesn't work: <form name="mainform"> <tr> <td colspan="2"> <select name="src" id="type"> <option value="http://www.mysite.com/results-car.html">Auto</option> <option value="http://www.mysite.com/results-home.html">Home</option> <option value="http://www.mysite.com/results-life.html">Life</option> <option value="http://www.mysite.com/results-health.html">Health</option> <option value="http://www.mysite.com/results-motorcycle.html">Motorcycle</option> <option value="http://www.mysite.com/results-business.html">Business</option> </select> </td> <input type="hidden" name="source" value="google" /> <tr> <td><input type="text" name="zipcode" maxlength="5" id="zip" /> </td> </tr> <tr> <td colspan="2" style="text-align:center;"><input type="submit" id="button" value="Go"/></td> </tr> </table> </form> For example, for auto insurance the URL should be: http://www.mysite.com/results-car.html?zipcode=10001&source=google Thanks!!
-
How to pass a variable in my URL to the next page
It works. Thank you very much!
-
How to pass a variable in my URL to the next page
And what I have to write in the value=""? <input type="hidden" name="source" value="" /> Thanks!
-
How to pass a variable in my URL to the next page
Hi! I would like to know how do I pass a variable in my URL to the next page. For example, my URL is: www . mysite.com?source=google I'm using this form code to go to the next page: <form action="www . mysite.com/next-page.html" method="get" name="form"> <input type="text" name="zipcode" maxlength="5" id="zipcode" /> <br /> <input type="submit" id="button" value="Go"/> </form> So the next page URL will be: www . mysite.com/next-page.html?zipcode=11111 I want that the variable "google" will be also in this URL: www . mysite.com/next-page.html?zipcode=11111&source=google How I do that? Thanks, Steve
-
Zip code verification
Hi! How can I create on my site an error message when the user submits an invalid zip code? For example, in this site: carinsurancequotes.com , if I submit the zip code 99999 I get an error message: Please enter a valid zip code. This is the code on my site: <form action="the next page" method="get" name="form"> <input type="text" name="zipcode" maxlength="5" id="zipcode" /> <br /> <input type="submit" name="search" id="button" value=""/> </form> Thanks, Steve
-
Dropdown Menu
I have used this site to create the menu and the submit button: http://javascript.internet.com/generators/drop-down-menu.html (I chose the option "Use button") My question is how do I center the text so that the text will be in the center of the box and not as it is now: http://www.mypicx.com/11162010/screenshot/ Thank you, Steve