Location.href Understanding?

B

Bruce A. Julseth

I have a FrontPage developed page where I'm using JavaScript for client side
code.

After the user enters the data, he clicks on a submit button with following
code.

<input type="submit" value="Submit" name="Make_Reservation"
onclick="MakeReservation()">

Function "MakeReservation" validates the data. If validation is successful,
the last statement in this function is:
window.location.href = "./SaveReservation.php";

The routine, "SaveReservation.php" is never loaded. I have tested the
SaveReservation.php routine directly from the URL Address line and it work
correctly.

What am I missing on trying to pass control to "SaveReservation.php."

Thanks

Bruce
 
B

Bruce A. Julseth

My apologies for being so ignorant but what is a "well formed URL." I tried
to replace "./SaveReservation.php";" with
http://localhost:8080/mydomain/SaveReservation.php. That didn't work. I
didn't try "C:/Inetpub/wwwroot/mydomain/SaveReservation.php."

As for the correct relative path, "SaveReservation.php" is in the same
directory at the page that is calling it, therefore, I think the correct
relative path is "./SaveReservation.php". Oh, yah, I also tried
"window.location.href = "SaveReservation.php"; i.e. I used the default
relative path.

Thanks for your help. Appreciate you taking the time to assist me.

Bruce
 
B

Bruce A. Julseth

I just discovered that the main webpage, the one that contains the function
which contains the statement "window.location.href =
"./SaveReservation.php"; is being reloaded with a set of "GET" parameters.
So, I am initially loading http://localhost:8080/mydomain/schedule.htm BTW:
schedule.htm is a frame page. Loaded into the "Main" frame, is
"Reserve.php". Here I select the reservation values, and submit via: "<input
type="submit" value="Submit" name="Make_Reservation"
onclick="MakeReservation()">". The function "MakeReservation()" has the
location.href="./SaveReservation.php" statement in it.

What is happening when I click the submit button, the function,
"MakeReservation()" is being run but what is being loaded is the "Main
Frame" window routine, Reserve.php" with a series of GET parameters, i.e.
"Reserve.php?P1=1&P2=2"

I hope this helps you determine what my problem is.

Thanks again for taking the time assist.

Bruce
 
S

Steve Easton

If this is a FrontPage generated form, you can't alter or add code to the submit button
event.
It needs to be left just as FrontPage creates it.

Specifying where and how the form results are saved is done via the Form Properties
Dialog.


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
 
B

Bruce A. Julseth

I have removed the FrontPage generated links. (The "hidden" "commented"
code.)

Bruce
 
S

Steve Easton

If it's a FrontPage generated form it won't work if you do that.
If you edit any part of the web bot generated code, the form will fail.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
 
S

Stefan B Rusynko

A form (by it's nature) has an action (where it send the form data)
- in your case (after client side validation) it is to send the data to SaveReservation.php to process server side

You shouldn't be changing the action in your validation script,
- just preventing the action event from occurring if validation fails

See http://irt.org/script/157.htm and set the action in the form tag to SaveReservation.php






|I have removed the FrontPage generated links. (The "hidden" "commented"
| code.)
|
| Bruce
|
| | > If this is a FrontPage generated form, you can't alter or add code to the
| > submit button
| > event.
| > It needs to be left just as FrontPage creates it.
| >
| > Specifying where and how the form results are saved is done via the Form
| > Properties
| > Dialog.
| >
| >
| > --
| > Steve Easton
| > Microsoft MVP FrontPage
| > 95isalive
| > This site is best viewed..................
| > ..............................with a computer
| >
| >
| > | >> I have a FrontPage developed page where I'm using JavaScript for client
| >> side
| >> code.
| >>
| >> After the user enters the data, he clicks on a submit button with
| >> following
| >> code.
| >>
| >> <input type="submit" value="Submit" name="Make_Reservation"
| >> onclick="MakeReservation()">
| >>
| >> Function "MakeReservation" validates the data. If validation is
| >> successful,
| >> the last statement in this function is:
| >> window.location.href = "./SaveReservation.php";
| >>
| >> The routine, "SaveReservation.php" is never loaded. I have tested the
| >> SaveReservation.php routine directly from the URL Address line and it
| >> work
| >> correctly.
| >>
| >> What am I missing on trying to pass control to "SaveReservation.php."
| >>
| >> Thanks
| >>
| >> Bruce
| >>
| >>
| >
| >
|
|
 
B

Bruce A. Julseth

clintonG said:
You speak as lucidly as you have in this matter yet you remain ignorant of
what the term 'well formed' means? And you do not even use search to find
out? Bad study habits; B-

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

My apologies for not being as intelligent and smart as you. I guess I'm just
didn't eat enough brats or cheese, or drink enough beer, when I was growing
up in WI. But I did then, and still do, route for the GB Packers. So, I
can't be all bad!

Also, I have been reprimanded for not putting my responses AT THE END of the
message, and now I see that someone like you, put them at the front. Since
you are, undoubtedly a member of Mensa, how can I solve this dilemma? At the
top or at the bottom?

Thanks for the come back. With your suggestion, I did a Google on "Well
Formed" discovered that it basically means all XML tags are "closed." Since
I can map "XML" structure to "HTML", guess that is what you were trying to
tell me.

Thanks again.

Bruce
 
B

Bruce A. Julseth

Stefan B Rusynko said:
A form (by it's nature) has an action (where it send the form data)
- in your case (after client side validation) it is to send the data to
SaveReservation.php to process server side

You shouldn't be changing the action in your validation script,
- just preventing the action event from occurring if validation fails

See http://irt.org/script/157.htm and set the action in the form tag to
SaveReservation.php



--

Sefan:

Thanks. Your suggestion fixed my problem and it now works like a "Champ".

Thanks again...

Bruce
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


|I have removed the FrontPage generated links. (The "hidden" "commented"
| code.)
|
| Bruce
|
| | > If this is a FrontPage generated form, you can't alter or add code to
the
| > submit button
| > event.
| > It needs to be left just as FrontPage creates it.
| >
| > Specifying where and how the form results are saved is done via the
Form
| > Properties
| > Dialog.
| >
| >
| > --
| > Steve Easton
| > Microsoft MVP FrontPage
| > 95isalive
| > This site is best viewed..................
| > ..............................with a computer
| >
| >
| > | >> I have a FrontPage developed page where I'm using JavaScript for
client
| >> side
| >> code.
| >>
| >> After the user enters the data, he clicks on a submit button with
| >> following
| >> code.
| >>
| >> <input type="submit" value="Submit" name="Make_Reservation"
| >> onclick="MakeReservation()">
| >>
| >> Function "MakeReservation" validates the data. If validation is
| >> successful,
| >> the last statement in this function is:
| >> window.location.href = "./SaveReservation.php";
| >>
| >> The routine, "SaveReservation.php" is never loaded. I have tested the
| >> SaveReservation.php routine directly from the URL Address line and it
| >> work
| >> correctly.
| >>
| >> What am I missing on trying to pass control to "SaveReservation.php."
| >>
| >> Thanks
| >>
| >> Bruce
| >>
| >>
| >
| >
|
|
 

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

Top