Re: credit card issue
| From: | Jason Lavigne | Date: | Tue, 05 Dec 2000 00:23:42 +0000 |
| Subject: | Re: credit card issue | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28559@lists.php.net to get a copy of this message | ||
I am not sure what you are trying to accomplish, but here are some
suggestions;
> > I did use
> > <script language="javascript">
> > self.location.replace( "/path/to/url/url_to_use.php" );
> > </script>
> > by putting it between the head tag and the page keep refreshing itself
> like
> > a non stop looping. I figure this part of javascript would need to be
put
> > elsewhere in the form but not know where should it be?
There is no place you can put the code above to get another result.
JavaScript is intrepid by the browser as the browser finds it. The above
code would be the same as doing a <meta> redirect (with out the timed delay
feature). Also JavaScript does not need to be in the header, you can put it
anywhere in the HTML, the only rule is if you need to call a function, the
function needs to be before the call.
> > And alternatively I did try
> > <script language="javascript">
> > request.reset;
> > </script>
> > and "request" is the name of the form. It return error says "request is
> > undefined". Any suggest?
Try using:
document.request.reset;
or
document.request.reset();
The "document" portion tells JavaScript to look in the current document for
"request". You did name your form like this;
<form name="request">
If you want to explain what it is you are trying to do, I would be more than
happy to try and help.
Jay
----- Original Message -----
From: "Brad Hubbard" <brad@congosystems.com>
To: "Jacky" <jacky@activelifestyle.com>
Cc: <php-general@lists.php.net>; <dave@hawk-systems.com>
Sent: Monday, December 04, 2000 7:10 AM
Subject: Re: [PHP] credit card issue
>
> > I did use
> > <script language="javascript">
> > self.location.replace( "/path/to/url/url_to_use.php" );
> > </script>
> > by putting it between the head tag and the page keep refreshing itself
> like
> > a non stop looping. I figure this part of javascript would need to be
put
> > elsewhere in the form but not know where should it be?
>
> Of course, you're right try changing your form tab to something like <form
> onSubmit='self.location.replace( "/path/to/url/url_to_use.php" );'>
> although this won't necessarily transfer your POST variables and therefore
> may be of limited value.
>
> > And alternatively I did try
> > <script language="javascript">
> > request.reset;
> > </script>
> > and "request" is the name of the form. It return error says "request is
> > undefined". Any suggest?
>
> You'll have to consult the DOM (Document Object Model) on this one, the
name
> of the form could be deeply buried. The following should get you started;
>
> <html>
> <head>
> <title>Untitled</title>
> </head>
>
> <body>
> <form name="foo">
> <input name="the_text" type="text" value="bar">
> </form>
> <input type="button" value="reset form"
> onClick="foo.reset();">
> <input type="button" value="change text"
> onClick="foo.the_text.value =
> 'Hi';">
>
> </body>
> </html>
>
> a reasonable knowledge of javascript is invaluable for a PHP programmer.
>
> Server side is only half the answer.
>
> Cheers,
> Brad
>
> P.S. I'm very surprised that Dave's solution was not appropriate (this is
> probably the best solution). Perhaps the solution is to rename your file
> whatever.php or whatever.phtml as the server should instruct any client
not
> to cache a file of type "application/x-httpd-php" anyway I believe.
> Hmmm..... strange days.
>
>
> P.P.S. Thanks for the code BTW Dave, saves typing it in, as I have done on
> many occasions 'cause I'm too lazy to write a class that will save me many
> keystrokes. Go figure huh? On the whole a very elegant solution.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>