--
// DvDmanDT
MSN: dvdm...@hotmail.com
Mail: dvdm...@telia.com
"Matt Palermo" <mpal...@vt.edu> skrev i meddelandet
news:001001c35233$f6a89940$4400a8c0@laptop...
No need to echo out the statement, better to use this method so you
dont have to escape each and every " existing:
// leave php to output html ?>
<A href="javascript:go_where_my_variable_says('this.php');">this
page</a>
<SCRIPT LANGUAGE="JavaScript">
<!--
function go_where_my_variable_says(where)
{
document.forms[0].action = where;
document.forms[0].submit();
}
//-->
</SCRIPT>
<?php // now back in php mode
>
> This displays the link fine for the submit hyperlink, but it gives the
> javascript error:
>
> Error: Object doesn't support this property or method.
> Code: 0
>
> Like I said before, this code works perfectly fine if I have it an html
> document.
>
> Anyone got any ideas?
With that being said I dont see a php problem here.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
Thanks,
Matt
>===== Original Message From Comex <n...@xemoc.cjb.net> =====
><3F46E4C7@zathras>
>Matt Palermo:
>> I just remembered (I'm not sure if it makes a difference) that I am
>> using frames on this page. Does this matter at all? Thanks.
>>
>> Matt
>
>No, it doesn't... well it shouldn't anyway. Check the source code of the
>outputted page. Is it exactly what you want it to be? If not, you might
>want to try using single quotes...
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
Matt
>===== Original Message From Curt Zirzow <cu...@zirzow.dyndns.org> =====
Matt
>===== Original Message From Matt Palermo <mpal...@vt.edu> =====
>Fixing the javascript that you specified still gave me the same
>errors... Got any more suggestions?
>
>Thanks for your help,
>
>Matt
>
>-----Original Message-----
>From: Jim Lucas [mailto:php...@zonedzero.net]
>Sent: Thursday, July 24, 2003 6:40 PM
>To: Matt Palermo
>Subject: Re: [PHP] Link acting as a submit button
>
>Your javascript is wrong.
>
>change this
> document.forms[0].action = where;
>to this
> document.forms[0].action.value = where;
>
>Jim Lucas
>> This displays the link fine for the submit hyperlink, but it gives the
>
>> javascript error:
>>
>> Error: Object doesn't support this property or method.
>> Code: 0
>>
>> Like I said before, this code works perfectly fine if I have it an
>html
>> document.
>>
>> Anyone got any ideas?
>>
>> Thanks,
>> Matt
But you say it works in a HTML page. So I still think you should check if
the output is right.
----- Original Message -----
From: "Matt Palermo" <mpal...@vt.edu>
try this
<a href="javascript: go_where_my_variable_says('<?php echo
$PHP_SELF;?>');">this page</a>
--
BigDog
Yes it matters tons with the javascript call.
Here is some info on it...however, these questions are now javascript
and not php...
1. make sure you pass in a valid page to your function.
2. make sure that you have a form that you are accessing.
3. make sure that when you access the form you are accessing the correct
frame page.
Example: when you set up the frames use the name attribute to assign
names to the frames...
so if you have a frame named frame1...then you can do this...
frame1.document.forms[0].action.value = where;
frame1.document.forms[0].submit;
I might be off on this a little but that should get you started in the
right direction.
--
BigDog
Any ideas?
Matt
>===== Original Message From big...@venticon.com =====
Any ideas?
[/snip]
Are you naming the submit buttons? Not just value, but id or name? You
must keep them seperate.
HTH!
--
BigDog
>===== Original Message From big...@venticon.com =====
Jim Lucas
----- Original Message -----
From: "Matt Palermo" <mpal...@vt.edu>
To: "Jim Lucas" <php...@zonedzero.net>; "Matt Palermo" <mpal...@vt.edu>;
"php-general" <php-g...@lists.php.net>
http://ca.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
"Matt Palermo" <mpal...@vt.edu> wrote in message
news:001001c35233$f6a89940$4400a8c0@laptop...
That's only if you're going between frames, if the whole form (as usual) is
on one frame it works fine.
I usually link into forms from other frames if I dont have a submit
button in that form.
--
BigDog