Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #12211 > unrolled thread

activating a JS script from PHP redirect

Started byScott Johnson <noonehome@chalupasworld.com>
First post2013-12-09 19:36 -0800
Last post2013-12-15 17:49 +0000
Articles 8 — 4 participants

Back to article view | Back to comp.lang.php


Contents

  activating a JS script from PHP redirect Scott Johnson <noonehome@chalupasworld.com> - 2013-12-09 19:36 -0800
    Re: activating a JS script from PHP redirect Jerry Stuckle <jstucklex@attglobal.net> - 2013-12-10 05:20 -0500
      Re: activating a JS script from PHP redirect Scott Johnson <noonehome@chalupasworld.com> - 2013-12-10 17:15 -0800
        Re: activating a JS script from PHP redirect Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-11 02:12 +0000
          Re: activating a JS script from PHP redirect Scott Johnson <noonehome@chalupasworld.com> - 2013-12-11 04:52 -0800
            Re: activating a JS script from PHP redirect Jerry Stuckle <jstucklex@attglobal.net> - 2013-12-11 13:35 -0500
              Re: activating a JS script from PHP redirect Scott Johnson <noonehome@chalupasworld.com> - 2013-12-11 15:50 -0800
    Re: activating a JS script from PHP redirect Fyndhorn Elder <bubble@caradhras.lan> - 2013-12-15 17:49 +0000

#12211 — activating a JS script from PHP redirect

FromScott Johnson <noonehome@chalupasworld.com>
Date2013-12-09 19:36 -0800
Subjectactivating a JS script from PHP redirect
Message-ID<l8627s$701$1@dont-email.me>
OK I will try to make this make sense.

I have an html page with JS that displays a DIV block after a link on 
that page is clicked.

The JS is looking for

Attributes from an <anchor> link:

rel='aaa'
href='bbb'
class='ccc'

to open the DIV.

Is there a way to call this html page from a different PHP page script 
that will cause the html to behave as if its anchor was clicked?

Thanks
Scotty

[toc] | [next] | [standalone]


#12213

FromJerry Stuckle <jstucklex@attglobal.net>
Date2013-12-10 05:20 -0500
Message-ID<l86psv$dev$1@dont-email.me>
In reply to#12211
On 12/9/2013 10:36 PM, Scott Johnson wrote:
> OK I will try to make this make sense.
>
> I have an html page with JS that displays a DIV block after a link on
> that page is clicked.
>
> The JS is looking for
>
> Attributes from an <anchor> link:
>
> rel='aaa'
> href='bbb'
> class='ccc'
>
> to open the DIV.
>
> Is there a way to call this html page from a different PHP page script
> that will cause the html to behave as if its anchor was clicked?
>
> Thanks
> Scotty

Scotty,

What do you mean by "call this html page from a different PHP page"?  Do 
you mean including the script in another page, loading the page with 
header('Location: xxx') or something else?


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#12215

FromScott Johnson <noonehome@chalupasworld.com>
Date2013-12-10 17:15 -0800
Message-ID<l88ebh$fvc$1@dont-email.me>
In reply to#12213
On 12/10/2013 2:20 AM, Jerry Stuckle wrote:
> On 12/9/2013 10:36 PM, Scott Johnson wrote:
>> OK I will try to make this make sense.
>>
>> I have an html page with JS that displays a DIV block after a link on
>> that page is clicked.
>>
>> The JS is looking for
>>
>> Attributes from an <anchor> link:
>>
>> rel='aaa'
>> href='bbb'
>> class='ccc'
>>
>> to open the DIV.
>>
>> Is there a way to call this html page from a different PHP page script
>> that will cause the html to behave as if its anchor was clicked?
>>
>> Thanks
>> Scotty
>
> Scotty,
>
> What do you mean by "call this html page from a different PHP page"?  Do
> you mean including the script in another page, loading the page with
> header('Location: xxx') or something else?
>
>

Currently there is only one page involved.

Lets say auto.html

On this page there is a quote link that calls a JS function on the page 
looking at the class, id and rel from the link, that then displays a 
currently hidden div that has the actual quote form on it.

Additionally there are 2 other pages.

An index.html page that has a quick quote form with a dropdown to select 
quote category (such as auto, home etc..) which when clicked calls a 
quote.php page which sends out an email to the agent.

What they would like to do is combine the quick quote on the index.html 
page to redirect to the category page, auto.html and display the quote 
form in one fell swoop.

I have created a solution and have the quote.php look at the post from 
the index.html form and then using header to redirect to the auto.html 
with a loaded url with query parameters.

Since the original JS does not look at the url I just created a new js 
that parses it.  I hate having 2 scripts do the same thing due to 
different modes of giving it parameters.

I suppose however that this is just the way it may have to be.

Scotty

[toc] | [prev] | [next] | [standalone]


#12216

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-12-11 02:12 +0000
Message-ID<l88hmd$rrp$1@dont-email.me>
In reply to#12215
On Tue, 10 Dec 2013 17:15:26 -0800, Scott Johnson wrote:

> Currently there is only one page involved.

> Lets say auto.html

> On this page there is a quote link that calls a JS function on the page
> looking at the class, id and rel from the link, that then displays a
> currently hidden div that has the actual quote form on it.

So your actual quote form is a hidden div on auto.html, rather than a 
separate quote.html.

> Additionally there are 2 other pages.

> An index.html page that has a quick quote form with a dropdown to select
> quote category (such as auto, home etc..) which when clicked calls a
> quote.php page which sends out an email to the agent.

So presumably the quick quote form entails different data entry to the 
quote form on auto.html?

Is auto.html for a specific type of insurance?

> What they would like to do is combine the quick quote on the index.html
> page to redirect to the category page, auto.html and display the quote
> form in one fell swoop.

It sounds to me as if the basic requirement is that:

Index.html has a "quote" menu

On the "quote" menu, you have a list of types of insurance (auto, 
building, home contents etc .....)

Selecting the relevant type of insurance should open up a form that 
captures data relevant to the insurance quote type.

This sounds more like a website structuring issue than a php or javascript 
issue. It sounds as if the existing website structure doesn't really 
match the way people are expected to use the website, which suggests that 
the website structure needs to be fixed.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#12217

FromScott Johnson <noonehome@chalupasworld.com>
Date2013-12-11 04:52 -0800
Message-ID<l89n5o$98g$1@dont-email.me>
In reply to#12216
On 12/10/2013 6:12 PM, Denis McMahon wrote:
> On Tue, 10 Dec 2013 17:15:26 -0800, Scott Johnson wrote:
>
>> Currently there is only one page involved.
>
>> Lets say auto.html
>
>> On this page there is a quote link that calls a JS function on the page
>> looking at the class, id and rel from the link, that then displays a
>> currently hidden div that has the actual quote form on it.
>
> So your actual quote form is a hidden div on auto.html, rather than a
> separate quote.html.
>
>> Additionally there are 2 other pages.
>
>> An index.html page that has a quick quote form with a dropdown to select
>> quote category (such as auto, home etc..) which when clicked calls a
>> quote.php page which sends out an email to the agent.
>
> So presumably the quick quote form entails different data entry to the
> quote form on auto.html?
>
> Is auto.html for a specific type of insurance?
>
>> What they would like to do is combine the quick quote on the index.html
>> page to redirect to the category page, auto.html and display the quote
>> form in one fell swoop.
>
> It sounds to me as if the basic requirement is that:
>
> Index.html has a "quote" menu
>
> On the "quote" menu, you have a list of types of insurance (auto,
> building, home contents etc .....)
>
> Selecting the relevant type of insurance should open up a form that
> captures data relevant to the insurance quote type.
>
> This sounds more like a website structuring issue than a php or javascript
> issue. It sounds as if the existing website structure doesn't really
> match the way people are expected to use the website, which suggests that
> the website structure needs to be fixed.
>

I agree wholeheartedly about the initial design/layout.  I believe it 
was designed and thrown together in a rush to just get a site up.  Now 
we have to come in from behind and make things work that where not 
designed to work.

I was able to create a solutions, but not one that I would be proud of 
having someone else see. ;)

Scotty

[toc] | [prev] | [next] | [standalone]


#12218

FromJerry Stuckle <jstucklex@attglobal.net>
Date2013-12-11 13:35 -0500
Message-ID<l8ab9n$59g$1@dont-email.me>
In reply to#12217
On 12/11/2013 7:52 AM, Scott Johnson wrote:
> On 12/10/2013 6:12 PM, Denis McMahon wrote:
>> On Tue, 10 Dec 2013 17:15:26 -0800, Scott Johnson wrote:
>>
>>> Currently there is only one page involved.
>>
>>> Lets say auto.html
>>
>>> On this page there is a quote link that calls a JS function on the page
>>> looking at the class, id and rel from the link, that then displays a
>>> currently hidden div that has the actual quote form on it.
>>
>> So your actual quote form is a hidden div on auto.html, rather than a
>> separate quote.html.
>>
>>> Additionally there are 2 other pages.
>>
>>> An index.html page that has a quick quote form with a dropdown to select
>>> quote category (such as auto, home etc..) which when clicked calls a
>>> quote.php page which sends out an email to the agent.
>>
>> So presumably the quick quote form entails different data entry to the
>> quote form on auto.html?
>>
>> Is auto.html for a specific type of insurance?
>>
>>> What they would like to do is combine the quick quote on the index.html
>>> page to redirect to the category page, auto.html and display the quote
>>> form in one fell swoop.
>>
>> It sounds to me as if the basic requirement is that:
>>
>> Index.html has a "quote" menu
>>
>> On the "quote" menu, you have a list of types of insurance (auto,
>> building, home contents etc .....)
>>
>> Selecting the relevant type of insurance should open up a form that
>> captures data relevant to the insurance quote type.
>>
>> This sounds more like a website structuring issue than a php or
>> javascript
>> issue. It sounds as if the existing website structure doesn't really
>> match the way people are expected to use the website, which suggests that
>> the website structure needs to be fixed.
>>
>
> I agree wholeheartedly about the initial design/layout.  I believe it
> was designed and thrown together in a rush to just get a site up.  Now
> we have to come in from behind and make things work that where not
> designed to work.
>
> I was able to create a solutions, but not one that I would be proud of
> having someone else see. ;)
>
> Scotty

Scotty,

Sounds like you're on the right track.  But isn't that always the case 
when you come in late to a project?  I don't know how many times I've 
found myself in a similar situation - it really needs to be rewritten 
but time and/or financial constraints don't allow it.

But as long as you've got it working right, you're the hero! :)

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#12219

FromScott Johnson <noonehome@chalupasworld.com>
Date2013-12-11 15:50 -0800
Message-ID<l8atno$so6$1@dont-email.me>
In reply to#12218
On 12/11/2013 10:35 AM, Jerry Stuckle wrote:
>
> Scotty,
>
> Sounds like you're on the right track.  But isn't that always the case
> when you come in late to a project?  I don't know how many times I've
> found myself in a similar situation - it really needs to be rewritten
> but time and/or financial constraints don't allow it.
>
> But as long as you've got it working right, you're the hero! :)
>

:)

Thanks

I figured you would probably relate.
Frustrating but hey, that's life.

Scotty

[toc] | [prev] | [next] | [standalone]


#12254

FromFyndhorn Elder <bubble@caradhras.lan>
Date2013-12-15 17:49 +0000
Message-ID<m2ob4iuhqq.fsf@caradhras.lan>
In reply to#12211
Scott Johnson <noonehome@chalupasworld.com> writes:

> OK I will try to make this make sense.
>
> I have an html page with JS that displays a DIV block after a link on
> that page is clicked.
>
> The JS is looking for

So you change things with 
<script>
function changeText(){
	document.getElementById('div id').innerHTML = 'foo;
}
</script>

>
> Attributes from an <anchor> link:
>
> rel='aaa'
> href='bbb'
> class='ccc'
>
> to open the DIV.
>
> Is there a way to call this html page from a different PHP page script
> that will cause the html to behave as if its anchor was clicked?
>

Yes, reload your page with a form action which is the same as your current php page,
then do isset on a $_POST["nameofvalue"] and contemplate.

FE

> Thanks
> Scotty

-- 
Time heals.
My blog : https://thediaryofelvishhealer.blogger.com

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web