Further questions about my site

J

Josh

I was wondering if anyone could point me in the direction for information to
solve the following problems with my site (under development).

The URL is
http://thesouthbeachhostel.com/php-testing/default.php?p=reservations. This
contents in this folder are not active yet. This is my first professional
site so I want everything to be as perfect as possible.

1) On the form there is a label "Check-in Date:" -- I want the small
calendar icon to line up with the text field. I can't get it to line up
perfectly.

2) Also, I want to make a JavaScript calendar pop up when the user clicks on
the calendar icon, which then transfers a date into the form. I don't know
JavaScript so I was wondering if anyone knew of a good free (or very cheap)
script that would do that function well. Is it difficult to learn to code
something like that? I like what Travelocity.com does on their homepage but
that might be too ambitious...

3) How do I make a secure connection with the server to transmit the credit
card numbers?

4) There is a "?" icon next the the text area for "type of accommodation."
How do I get a small popup to open when they click on that. I want to
provide information on what the different options in the select box mean.

Thanks in advance for any advice or resources anyone can provide.
 
M

McKirahan

Where to start...

Josh said:
I was wondering if anyone could point me in the direction for information to
solve the following problems with my site (under development).

The URL is
http://thesouthbeachhostel.com/php-testing/default.php?p=reservations. This
contents in this folder are not active yet. This is my first professional
site so I want everything to be as perfect as possible.

1) On the form there is a label "Check-in Date:" -- I want the small
calendar icon to line up with the text field. I can't get it to line up
perfectly.

Nothing appears after "Check-in Date: ".

Your source has the following line:
<script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>
but I couldn't find that "include" file at:
http://thesouthbeachhostel.com/php-testing/calendarDateInput.js

Note that as soon as I load the page I get two JavaScript Errors:

A Runtime Error has occurred.
Do you want to Debug?
Line: 1
Error: Expected ";"

If I click "No" then I get:

A Runtime Error has occurred.
Do you want to Debug?
Line: 165
Error: Object Expected

If I click "No" then I then the page loads.

Debugging both errors point to the same line:
DateInput('orderdate', true, 'DD-MON-YYYY')


2) Also, I want to make a JavaScript calendar pop up when the user clicks on
the calendar icon, which then transfers a date into the form. I don't know
JavaScript so I was wondering if anyone knew of a good free (or very cheap)
script that would do that function well. Is it difficult to learn to code
something like that? I like what Travelocity.com does on their homepage but
that might be too ambitious...

I'll get back to you later...
3) How do I make a secure connection with the server to transmit the credit
card numbers?

You'll need an SSL (Secure Socket Layers) ceritificate.
4) There is a "?" icon next the the text area for "type of accommodation."
How do I get a small popup to open when they click on that. I want to
provide information on what the different options in the select box mean.

Do you want your visitors to click on the "?" for the popup?

If so, then try:

<img src="images/question.gif" border="0" align="middle" alt="Click here for
more information" onclick="Popup()" />

<javascript type="text/javascript">
function Popup() {
var pop = "Room Types: \n";
pop += "\n Small Mixed Dorm";
pop += "\n Large Mixed Dorm";
pop += "\n Female Dorm";
pop += "\n Private Room";
var win = window.open("","Popup","")
win.document.write(pop);
}
 
J

Josh

McKirahan said:
Where to start...

information

Nothing appears after "Check-in Date: ".

Your source has the following line:
<script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>
but I couldn't find that "include" file at:
http://thesouthbeachhostel.com/php-testing/calendarDateInput.js

Note that as soon as I load the page I get two JavaScript Errors:

A Runtime Error has occurred.
Do you want to Debug?
Line: 1
Error: Expected ";"

If I click "No" then I get:

A Runtime Error has occurred.
Do you want to Debug?
Line: 165
Error: Object Expected

If I click "No" then I then the page loads.

Debugging both errors point to the same line:
DateInput('orderdate', true, 'DD-MON-YYYY')

Sorry... I've been working on the site since I posted that message. I found
a free calendar script on www.dynamicdrive.com that I am trying to get to
work correctly. It was working fine but then it disappeared from my form.
I think the script might have some bugs in it.

You'll need an SSL (Secure Socket Layers) ceritificate.

I'll search for that on Google...

mean.

Do you want your visitors to click on the "?" for the popup?

If so, then try:

<img src="images/question.gif" border="0" align="middle" alt="Click here for
more information" onclick="Popup()" />

<javascript type="text/javascript">
function Popup() {
var pop = "Room Types: \n";
pop += "\n Small Mixed Dorm";
pop += "\n Large Mixed Dorm";
pop += "\n Female Dorm";
pop += "\n Private Room";
var win = window.open("","Popup","")
win.document.write(pop);
}
</script>


Thanks for that help. I will try it out...
 
J

Josh

<img src="images/question.gif" border="0" align="middle" alt="Click here for
more information" onclick="Popup()" />

<javascript type="text/javascript">
function Popup() {
var pop = "Room Types: \n";
pop += "\n Small Mixed Dorm";
pop += "\n Large Mixed Dorm";
pop += "\n Female Dorm";
pop += "\n Private Room";
var win = window.open("","Popup","")
win.document.write(pop);
}
</script>

A question: I don't know much about JavaScript. Today is my first day of
trying to use it.

Should it be <javascript type="text/javascript">, or just <script
type="text/javascript">? (the closing tag is </script>.)

I added the code but it doesn't add the new lines (\n). It's a full new
browser window. Is there anyway to resize it and remove all of the
navigation and menu bars?

Thanks
 
M

McKirahan

Josh said:
A question: I don't know much about JavaScript. Today is my first day of
trying to use it.

Should it be <javascript type="text/javascript">, or just <script
type="text/javascript">? (the closing tag is </script>.)

I added the code but it doesn't add the new lines (\n). It's a full new
browser window. Is there anyway to resize it and remove all of the
navigation and menu bars?

Thanks

Try:

<javascript type="text/javascript">
function Popup() {
var pop = "Room Types: <br>";
pop += "<br>Small Mixed Dorm";
pop += "<br>Large Mixed Dorm";
pop += "<br>Female Dorm";
pop += "<br>Private Room";
var win = window.open("","Popup","width=200,height=200")
win.document.write(pop);
}
</script>
 
J

Josh

McKirahan said:


I tried this and it works, but the popup seems to be perpetually loading.
The mouse shows an hourglass when hovering over the popup.

<script type="text/javascript">
function Popup() {
var pop = "Room Types: <br>";
pop += "<br>Small Mixed Dorm";
pop += "<br>Large Mixed Dorm";
pop += "<br>Female Dorm";
pop += "<br>Private Room";
var win = window.open("","Popup","width=200,height=200")
win.document.write(pop);
}
</script>
 
M

McKirahan

Josh said:
I tried this and it works, but the popup seems to be perpetually loading.
The mouse shows an hourglass when hovering over the popup.

<script type="text/javascript">
function Popup() {
var pop = "Room Types: <br>";
pop += "<br>Small Mixed Dorm";
pop += "<br>Large Mixed Dorm";
pop += "<br>Female Dorm";
pop += "<br>Private Room";
var win = window.open("","Popup","width=200,height=200")
win.document.write(pop);
}
</script>


Don't know about that; it doesn't for me.
 
J

Josh

McKirahan said:
Don't know about that; it doesn't for me.

Hmm... I wonder what it could be. In any case I just bought two books on
JavaScript today. I guess I have to study some more. There is so much to
learn and not much time...

Thanks for your help.
 
G

Grant Wagner

Josh said:
I tried this and it works, but the popup seems to be perpetually
loading.
The mouse shows an hourglass when hovering over the popup.

<script type="text/javascript">
function Popup() {
var pop = "Room Types: <br>";
pop += "<br>Small Mixed Dorm";
pop += "<br>Large Mixed Dorm";
pop += "<br>Female Dorm";
pop += "<br>Private Room";
var win = window.open("","Popup","width=200,height=200")
win.document.write(pop);
}
</script>

Don't rely on the new window being open and ready for writing when you
call document.write(). The following code will work more reliably (in
browsers where you can actually open a new window at any rate):

<script type="text/javascript">
window.newWindowHtml = [
"Room Types:<br>",
"Small Mixed Dorm",
"Large Mixed Dorm",
"Female Dorm",
"Private Room"
].join('<br>');

var win = window.open(
"javascript:eek:pener.newWindowHtml",
"winName",
"width=200,height=200"
);
</script>

It's not a bad idea to write 100% valid HTML to the new window, even if
you're doing it via script:

window.newWindowHtml = [
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
'<html>',
'<head>',
'<title>Untitled</title>',
'</head>',
'<body>',
'Your content here',
'</body>',
'</html>'
].join('\n');
 
M

McKirahan

Grant Wagner said:
Josh said:
I tried this and it works, but the popup seems to be perpetually
loading.
The mouse shows an hourglass when hovering over the popup.

<script type="text/javascript">
function Popup() {
var pop = "Room Types: <br>";
pop += "<br>Small Mixed Dorm";
pop += "<br>Large Mixed Dorm";
pop += "<br>Female Dorm";
pop += "<br>Private Room";
var win = window.open("","Popup","width=200,height=200")
win.document.write(pop);
}
</script>

Don't rely on the new window being open and ready for writing when you
call document.write(). The following code will work more reliably (in
browsers where you can actually open a new window at any rate):

<script type="text/javascript">
window.newWindowHtml = [
"Room Types:<br>",
"Small Mixed Dorm",
"Large Mixed Dorm",
"Female Dorm",
"Private Room"
].join('<br>');

var win = window.open(
"javascript:eek:pener.newWindowHtml",
"winName",
"width=200,height=200"
);
</script>

It's not a bad idea to write 100% valid HTML to the new window, even if
you're doing it via script:

window.newWindowHtml = [
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
'<html>',
'<head>',
'<title>Untitled</title>',
'</head>',
'<body>',
'Your content here',
'</body>',
'</html>'
].join('\n');

I like it; thanks Grant.

<html>
<head>
<title>popupper.htm</title>
<script type="text/javascript">
function Popup() {
window.newWindowHtml = [
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
'<html>',
'<head>',
'<title>Untitled</title>',
'</head>',
'<body>',
'Room Types:',
'<li>Small Mixed Dorm',
'<li>Large Mixed Dorm',
'<li>Female Dorm',
'<li>Private Room',
'</body>',
'</html>'
].join('\n');
var win = window.open(
"javascript:eek:pener.newWindowHtml",
"winName",
"width=200,height=200"
);
}
</script>
</head>
<body>
<a href="javascript:popup()">Popup</a>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top