Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | Convert real video 10 to real video 9

You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > General IT Discussion
Register FAQ Community Calendar

ANOTHER question about JavaScript!!
Reply
 
Thread Tools
Old 19-05-2004, 23:26   #1
Womble
cf.geek
 
Womble's Avatar
 
Join Date: Jul 2003
Location: In A Politically Correct Hell!! Viva La Revolution
Age: 59
Services: 1gig Broadband
Posts: 864
Womble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of Quads
ANOTHER question about JavaScript!!

Can anyone help? Below is my little JavaScript, my problem is I want the output to have astrix around it like so but cant remember how to do it..doh!
***********************************
The price of your ticket is
***********************************

This is my script............................................ .....................................
// to check the status of a prospective ticket purchaser
var age;
age = window.prompt('Please enter your age', '');
age = parseFloat(age);
while (age<5)
{
document.write ('You have made a mistake, please re-enter your age'+ '<BR>')
age = window.prompt('Please re-enter your age', '');
age = parseFloat(age);
}
if (age >59)
{
document.write
('The price of your ticket is a concessionary £8')
}
if (age <17)
{
document.write
('The price of your ticket is a concessionary £8')
}

else
{
document.write('The price of your ticket is £10')
}


Thanks for any input
Womble is offline   Reply With Quote
Advertisement
Old 19-05-2004, 23:38   #2
Richard M
Inactive
 
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Re: ANOTHER question about JavaScript!!

What's wrong with doing:

document.write('********************************** *<br />The price of your ticket is £10<br />***********************************')

?
Richard M is offline   Reply With Quote
Old 20-05-2004, 00:22   #3
Womble
cf.geek
 
Womble's Avatar
 
Join Date: Jul 2003
Location: In A Politically Correct Hell!! Viva La Revolution
Age: 59
Services: 1gig Broadband
Posts: 864
Womble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of Quads
Re: ANOTHER question about JavaScript!!

Quote:
Originally Posted by Richard M
What's wrong with doing:

document.write('********************************** *<br />The price of your ticket is £10<br />***********************************')

?
I never thought of that!!
Blinding idea
Thank you
Womble is offline   Reply With Quote
Old 20-05-2004, 00:32   #4
Womble
cf.geek
 
Womble's Avatar
 
Join Date: Jul 2003
Location: In A Politically Correct Hell!! Viva La Revolution
Age: 59
Services: 1gig Broadband
Posts: 864
Womble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of QuadsWomble has a fine set of Quads
Re: ANOTHER question about JavaScript!!

Ahh, it doesn't work!! I hate coding!!!!!!!!!!!
Womble is offline   Reply With Quote
Old 20-05-2004, 00:36   #5
punky
Inactive
 
Join Date: Jun 2003
Age: 45
Posts: 14,750
punky has a golden aurapunky has a golden aura
punky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aura
Re: ANOTHER question about JavaScript!!

Try using the HTML Entity value. For a * it is:

*

Put that anywhere in your HTML, and it would produce an asterix. Should work inside your document.write.

HTH

Edit: I forgot the entity automatically gets parsed into an astrisk , sorry it is:

[&][#][4][2][;]

but without the [ and ]. All as one word.
punky is offline   Reply With Quote
Old 20-05-2004, 02:40   #6
punky
Inactive
 
Join Date: Jun 2003
Age: 45
Posts: 14,750
punky has a golden aurapunky has a golden aura
punky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aura
Re: ANOTHER question about JavaScript!!

I thought your question was a bit weird Womble, so I decided to test it, and:

document.write('*****************<br>');

works fine for me. You must have a problem elsewhere. Can you post the whole file for us?
punky is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 20:54.


Server: lithium.zmnt.uk
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum