I have to create a website as a project for my university course. Said course has nothing at all to do with computers really so it's really throwing us into the deep end as the majority of us have/had no interest in this particular field.
Regardless, I am creating a website that uses the Random Quote Generator Javascript that I copied from the Hotscripts website. The code details are below and my question is: is there any way I could change the formatting for each quote? For example, change quote 1 to be, say, yellow or bold and change quote 3 to be aligned right and blue? I mainly want to change the colour for each quote but having any other info on how to format it would be really helpful.
var quotes=new Array(); quotes[0] = "This is quote 1."; quotes[1] = "This is quote 2."; quotes[2] = "This is quote 3.";
i need, requires a little extra tweaking. Its a price quote generator (package price x number of pages = price) However if the customer has more pages over a set amount (2000) the package price changes. So the formula becomes (package price x pages (upto 2000) = price + number of pages over 2000 x new package price = Total price. Does that make sense?
So i can do a flat rate with this code but if anyone has suggestions on how to do the rest? I would be eternaly grateful as my head really hurts.
<head> <script type="text/javascript"> function update(){ var price = document.getElementById("Package").value; var pages = document.getElementById("pages").value; var Tprice = (price * pages).toFixed(2) ;
i have a long string contain html tags, javascript code, in a variable, & of corse it contain both ' & " in it.now i want to put all the stuff somewhere in my page, so i assume should use .html() for this. but i think because of this ' & " it does not working. what should i do?
am writing a function in js that requires me to assign an javascript value to an html element. But I am stuck at a point where I have to assign document.write value to embed object.
function ytEmbedPlayer(videoUrl,w,h){ var flashvars = {}; var params = {allowFullScreen:'true',wmode:'transparent'}; params.allowscriptaccess = "always";
[code]....
I am having issue here were, I have to print videoUrl value as an embed src.
<embed src="document.write(videoUrl)"
I think I am messing up with the single quote and double quote.
I am trying to take code that I have and change it to be called from an XML file.
Right now I have random quote and random author arrays stored in an external .js file. And then a function to make everything random. Then I have it called and modified using the innerhtml method. All of this works fine and I will be including that code.
Now I want to modify this and change it to where I can store my quotes and my quote authors in an xml file. Then called through the JS. (more info under this code)
I'd like to have a js random image (1 out of 4) load each time a user visits my page. Along with that image, I'd like a specific quote and sub heading (text) to appear -the quote can be text or another graphic.In other words, if random image '1' is loaded, 'quote 1' (text or another graphic) and 'sub head 1' (html text) is loaded, if random image '2' is loaded, 'quote 2' and 'sub head 2' (html text) is loaded, and so on...
I have an asp form where one field has potential for entry of single quote (usually a possessive -bob's-).How can I replace "'"with "`" before it is passed forward generating an error.
how can i use the .indexof function to check if there is a quote in the string. i can't seem to find the correct syntax for do this without an error occuring
I need a code for my online blind shop so that customers can get a quote without having to go through the order process. They would need to enter their fabric range, style and width and drop.
I'm looking for a wee bit of regex help as I need to add a slash before any instances of double quotes in a string. I'm using an AJAX in place editor which is cutting off strings at double quotes - the following line is giving me problems when the text being edited has a double quote in it:
Code:
I have this function, but this is for adding slashes to single quotes and my regex ability is so inept i don't know how to amend it for double quotes only.
I've got the following form validation script. How can I include the quote marks as a bad character?
I tried: var bad_email_chars="/!#$%&*+^ ()_-=|~`?;:,'""" It didn't help.
if(form1.elements(i).name=="text_website") { var bad_email_chars="/!#$%&*+^ ()_-=|~`?;:,'" var h,j for(h=0;h<bad_email_chars.length;h++) { for(j=0;j<input_str.length;j++) { if(bad_email_chars.charAt(h)==input_str.charAt(j)) { alert("you have atleast one bad character in you website address. You may not submit this form until you correct this.") window.event.returnValue=false form1.elements(i).focus(); }}}}
Also, How do I format with indentations and as non wraping text the messages I send to this forum?
Does anyone have code to restrict input of a singli quote and a backslash in input field? I need to make sure this code works in IE, FF, Opera. Well, all major browsers
I am trying to come up with an instant price quote calculator in javascript.it would be a simple one with only three fields:
"label" -Number of Shirts "label" -Number of Colors on Front "label" -Number of Colors on Back "button" calculate total "results" total: $xx per bagxx
total price would decrease based on the number of shirts (more volume) / increase based on the number of colors both front and back.
something i found online that is 100% what i want:[URL]i am not too familiar with javascript. ok tinkering with jquery but that's it.i am obviously not asking anyone to work for free but if someone could point me to a semblance of a solution, some code, something online that i could modify etc. i would love to learn javascript in the process and ideally come up with a working version of the calculator.
i tried to work with the .js from that website but it calls in some qq2.php page. so i haven't been able to replicate the solution. plus, i would assume that their price structure would be different than mine.
rounding the quote up to two decimal places. I've seen a lot of codes and tried a bunch (math.round, tofixed, toprecision) but not exactly sure how to use them and where to put them. Calculator can be viewed here along with the code [URL]
I am creating a simple web form and am having trouble with a quick jQuery script I am using. A few of the fields on my form are not needed if the topic is not "Get a Quote" so I have a script that hides them if "Get a Quote" is not selected in a dropdown box. I does hide them if I select something else but when I go back to "Get a Quote" the fields do not reappear. $(document).ready(function(){ $("#CAT_Custom_169338").change(function(){ if ($(this).val() == "Get A Quote" ) { $(".showmore").slideDown("fast"); //Slide Down Effect } else { $(".showmore").slideUp("fast"); //Slide Up Effect }});});
I have a site I am working on that I did not build and am having problems with an ajax / javascript call.I was hoping someone with firebug could take a look. I have firebug but I am not a js guy.The big green button that says add to quote list is a link with an image BG. It should swap classes when clicked therefore changing the BG image to a red one as well as the text at the very top right of the screen swapping to add a number to the list of items in the quote list.Sometimes it works... I think only the first time it is clicked, sometimes the text in the top right changes but the image does not etc. If you click it and it does nothing but the refresh the page then the class will change which is weird, it's like it's trying to switch but cant until you reload the page.
I've put together a function for screen scraping, just to see if I could do it. Basically, this gets a stock quote from Yahoo! and displays it. It works with no issues in IE7. FF and Chrome, however, it does not work. It will not display anything. Error Console is not returning any errors, and I'm a total novice when it comes to troubleshooting with FireBug.
[Code]....
I'm sure it's something simple, something I've overlooked. I'm beginning to think it might be with the trenary conditional setting the method.
I'm trying to put a rotating testimonial effect in the header (working) and use a Phatfusion style image menu (not working). I know the menu uses MooTools and the other a google script?Honestly, I've been going at this for a while and don't know that I know enough about javascript yet to understand what to do...
I have a JavaScript application that needs to preserve double quote marks and apostrophes (" and ') that are entered into form fields by the user. The form data is passed through several screens using hidden fields.
Right now, apostrophes work because I have the input fields coded as value="". I have not found a way for JavaScript to retrieve the field's value if double quotes are entered by the user. If I change the parameter to value='' (single quotes) then the apostrophes probably won't work.
Is there a straightforward way for JavaScript to retrieve the field value containing quotes, so that I can manipulate it into a different string that can be easily passed between HTML pages?