Script Not Telling Difference Between Percent Signs And Asterisks / Why Is So?
Mar 25, 2010
I am using Javascript to generate a SQL query. When querying, I DO want asterisks to serve as a wildcard, but do NOT want percent signs to do so.
So, I have some code like this code...
But the above replaces asterisks with "!%" also! That's exactly what I don't want to have happen!
Does anyone know what I am missing here?
View 1 Replies
ADVERTISEMENT
Jul 23, 2010
I have a value which contains sth like this:
"200x200(+100
.00)"
...and now I want to get that "100" value and set this as a new variable. My target(100) is between sign + and .
View 2 Replies
View Related
Oct 4, 2010
I'm trying to make a site where when you click the submit button it puts an asterisk next to all of the incomplete fields while also displaying an alert box. I'm having no luck with it so far since I don't know how to get a script to print something to a specific part of a page. Here is what the whole thing looks like so far. I tried using page-jumping but that didn't work:
[Code].....
View 8 Replies
View Related
May 7, 2009
I am trying to make an application that displays a pattern of asterisks a certain way. the only output statements I could use are to get the pattern below. My question would be which way to use the nested loop, (do i do while(if else)...
[Code]...
View 10 Replies
View Related
Jun 9, 2010
I have the following calculation (simplified to focus on the point):
Code:
var scroll_percentage = scroll_button_distance/scroll_wrapper_width;
or imagine this is:
Code:
var scroll_percentage = 100/500;
The answer is -INFINITY
How do I make this into a usable number?I searched for INFINITY and found plenty of info but am not sure how to simply get the "0.2" answer I need for the next calculations.
View 3 Replies
View Related
Apr 1, 2010
I'm using this plugin:I was wondering if anybody knew of a way to place a percent mask on one input field that can have the possibility to be in both of these formats..
field
<input type="text" id="interest_rate" />
mask
[code]...
View 1 Replies
View Related
Feb 23, 2010
function update(value1){
doAjax("behind_scan.php" , "id="+value1);
}function doAjax(url , str ){
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null){
alert ("Browser does not support HTTP Request");
return;
}url=url+"?"+str;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}function stateChanged(){
if (xmlhttp.readyState==4){
//document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
//alert(xmlhttp.responseText)
document.forms.myform.scanner.value = "";
document.forms.myform.scanner.focus();
}}function GetXmlHttpObject(){
if (window.XMLHttpRequest){
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}if (window.ActiveXObject){
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
} return null;
}
This pages calls a function on a separate php page to run 2 mySQL queries, the value must be put in the text 3 times in quick succession before the database is altered. I've tried all the other functions and they seem to be fine, AJAX is my weakness but I need it for the main functionality of my website. I need this to work.
View 2 Replies
View Related
Jul 1, 2011
I have 2 things going on here. One, the 'percent' variable is constantly showing up as NaN (not a number) no matter what numbers I give it. I suspect it is happening because the function is populating all the fields at one, which causes a 'divide by zero' scenario for the percentage field, which is last in line. Which brings me to my send thing. How to write this function correctly, as it obviously is causing problems as is, and it seems clunky. I think it should broken up into a couple different functions, but I tried that and NOTHING worked.
Here is the code, let me kow what you think:
function calculate(){
var contractsAdded = document.forms[0].contractsAdded.value;
var priceAdded = document.forms[0].priceAdded.value;
var contractsSold = document.forms[0].contractsSold.value;
var priceSold = document.forms[0].priceSold.value;
var totalAdded = (contractsAdded * priceAdded) * 100;
var totalSold = (contractsSold * priceSold) * 100;
var gainLoss = totalSold - totalAdded;
var percent = gainLoss / totalAdded;
document.forms[0].totalAddedCost.value = totalAdded;
document.forms[0].totalSoldCost.value = totalSold;
document.forms[0].gainLoss.value = gainLoss;
document.forms[0].returnPercent.value = percent;
}
View 4 Replies
View Related
Jan 10, 2010
right now im using a percent bar to redirect the page when all buttons are clicked but i want a more efficient way of doing the redirect there will be a total number of buttons on my page, for examply 5 every time one is clicked, is there a possible way of subtracting 1 and when buttons = 0 the page redirects
View 1 Replies
View Related
Mar 11, 2011
I have script function. It works perfectly in IE -9 32 bit machine.but the getting a run time error in IE - 9 64 bit machine.
View 2 Replies
View Related
Oct 20, 2010
I'm studing the jquery API for .eq() and :eq() , As i read in the comments a user said :
I found that using this method instead of the inline string :eq() is faster.
Do these methods hava differences?and which are these differences?
View 3 Replies
View Related
Jul 16, 2009
i wrote a rough script to try and test which method of incrementation was faster: i+=1; i++; ++i;
[Code]...
View 9 Replies
View Related
Sep 8, 2011
I inherited an html demo (used to show customers our product w/o being connected to a server). Was going through the Html files to update the dates and fields and it seems that on some html files, when I change a date <td>08/11/2008 </td> to <td>08/11/2011</td>, save and refesh, I start getting a bunch of JS errors when I try and log back into the demo. I'm not changing anything in the JS files, so I don't understand why the errors are occuring.
I have a bunch of html files to change, and now, no matter which file I change (the dates, sample names, etc), I lose functionality on that particular page.
View 3 Replies
View Related
May 1, 2010
Here is my problem, I am trying to get the difference of two different date. I want to get how much hour and second is their different. My problem is the 1st date is using a different format this is the example:2010-05-01 13:46:04 the second one is I am trying to get the today's time and date by using this code: "currentTime.getTime()". Here is my whole code
[Code]...
View 5 Replies
View Related
Aug 23, 2009
What is the difference between DOM, Javascript and DHTML?
Alert() and document.write() is a DOM method or Javascript method?
View 6 Replies
View Related
Oct 22, 2002
document.write("<td><a href=clips/"+genericname+".mpg document."+genericname+".dynsrc='clips/"+genericname+"mpg' src=logos/"+genericname+".jpg name="+genericname+" border=0></a></td>");
This line is meant to be used in conjunction with a loop routine in <script> brackets within the main <body>. What it should do is display a file pictures and then play its mpg file on a mouseover, for a generic filename that can be changed. That i can do. The problem is within the line ...
document."+genericname+".dynsrc='clips/"+genericname+"mpg'
Here i want to play the mpg and keep its height at 75. The problem is that it doesn't work. I think that the two document strings should be surrounded by "...
document."+genericname+".height=྇' document."+genericname+".dynsrc='clips/"+genericname+"mpg' "
However because i'm using the "+genericname+" command within the line, i can't use " to surround the two document strings. I've tried to do it as a function, but i can't get it to work as a generic function.
View 7 Replies
View Related
Jun 1, 2009
I would like to know how to achieve this. I want to know the difference between two dates in months, how much days left over, and how much hours left over. I do not need days or hours equivalent to the months remaining. The problem is I also want it to consider February's less than 30 days and 29 days in leap year. I spend my entire week trying to figure out how to do it.
In the end I want values in variable months_left, days_left, and hours_left. I tried modifying several date deference scripts but I couldn't get them to work as intended.
View 3 Replies
View Related
Aug 4, 2005
I have specific requirement in web development. I am Programmer Analyst in .Net, would like to know the difference between Firefox and IE6.0.Some of the Javascript will not execute in Firefox Does any one have better idea about this
View 5 Replies
View Related
Jul 23, 2005
For my website i would like to display the age of my son in years,
months, days and hours.
For now i manage to get a result for totals. Like the total number of
days.
This is the beginning:
starttime = Date.parse("Aug 10,2003, 07:07")
sdt = new Date(starttime)
starttime= Math.ceil((starttime) / 1000 / 60 / 60 / 24 )
ndt = new Date()
y = sdt.getYear()
m = sdt.getMonth() + 1
d = sdt.getDate()
h = starttime
View 26 Replies
View Related
Jul 23, 2005
I don't know where the actual issue is, but hopefully someone can explain.
The following displays "5" in FireFox, but "3" in IE:
<script type="text/javascript" language="javascript">
var newString = ",a,b,c,";
var treeArray = newString.split(/,/i);
alert(treeArray.length);
</script>
View 1 Replies
View Related
Oct 14, 2006
Can someone please explain why the following code works in IE but not firefox please.
In ie I get an alert box with "mynewprop" but in Firefox I get "undefined"....
View 2 Replies
View Related
Nov 10, 2006
I have two date fields (check in, check out) and "number of days"
field.
I want the script to calculate automatically the difference.
For example: I have defaults dates, and I want the script to put the
difference in "number of days" field. And if the user will change the
date, the number of days will change automatically.
View 1 Replies
View Related
Jul 12, 2011
I've been using 1.3 which allows me to query non-standard attributes on tag. On an anchor I set a value="" attribute and was able to say (in an onclick binding) $(this).attr('value') to get the value. This no longer works with 1.6. Is there another, better way to do this?
View 5 Replies
View Related
Dec 23, 2011
Since jquery 1.7 there is a new method, named: on(). What is the difference between .bind() and .on()?
[URL]
View 1 Replies
View Related
Nov 6, 2011
Was wondering, other then the syntax difference, should the below to bits not end up with the same result?
$("details").not("summary");
$("details :not(summary)");
View 2 Replies
View Related
May 2, 2010
Lets say I had a wrapped set of <p> elements. I understand how slice could return more than one element, but what is the difference between nth-child() and eq()?
$('p:nth-child(3)').css("font-style","italic");
$("p:eq(2)").css("font-style","italic");
$("p").slice(2,3).css("font-style","italic");
View 7 Replies
View Related