using java variables outside of script

  • Thread starter Massey in Binghamton
  • Start date
M

Massey in Binghamton

I've created a survey web with multiple pages. Each page will be submitted
separately and the pages will be connected by way of a unique id number. I
created the id number using a Java script that combines the participant's
remote ip and the date and time. Unfortunately, I can't figure out how to
get that variable from the Java script back into Frontpage so I can include
it as a hiddle variable that can be submitted with the rest of the form
variables. Any suggestions?
Thanks!!
 
R

Ronx

Is this Java or JavaScript? These two are very different and must never be
confused.
Assuming JavaScript.

The variable storing the IPaddress and date should be a global variable,
defined in the <head> of the page
<script type="text/javascript">
var ipDate = "";
// code to set value for ipDate
</script>

This can be set wherever.

In the form :
<script type="text/javascript">
document.write("<input type=\"hidden\" value=\"" + ipDate + "\">")
</script>
 
R

Ronx

Correction

In the form :
<script type="text/javascript">
document.write("<input type=\"hidden\" name=\"ipdte\" value=\"" + ipDate +
"\">")
</script>

This will not work if using the FrontPage extensions for processing the
form.
 
R

Ronx

This will work with FP extensions (and all other form handlers)

Place a hidden field in the form

<inp type="hidden" name="ipdte" value="">

and the following script at the end of the form (just before the </form>
tag.

<script type="text/javascript">
var ipDate;
ipDate = "ipaddress + date" //code to set value for ipAddress and date.
document.forms[0].ipdte.value = ipDate;
</script>

where [0] is the count of the form on the page, starting from 0.
 
M

Massey in Binghamton

Oh, and yes, I'm using Java Script within the FP document.

Ronx said:
This will work with FP extensions (and all other form handlers)

Place a hidden field in the form

<inp type="hidden" name="ipdte" value="">

and the following script at the end of the form (just before the </form>
tag.

<script type="text/javascript">
var ipDate;
ipDate = "ipaddress + date" //code to set value for ipAddress and date.
document.forms[0].ipdte.value = ipDate;
</script>

where [0] is the count of the form on the page, starting from 0.
--
Ron Symonds (Microsoft MVP - FrontPage)
Reply only to group - emails will be deleted unread.


Massey in Binghamton said:
I've created a survey web with multiple pages. Each page will be submitted
separately and the pages will be connected by way of a unique id number. I
created the id number using a Java script that combines the participant's
remote ip and the date and time. Unfortunately, I can't figure out how to
get that variable from the Java script back into Frontpage so I can
include
it as a hiddle variable that can be submitted with the rest of the form
variables. Any suggestions?
Thanks!!
 
M

Massey in Binghamton

Ronx,

Thanks for all the advice. Everything seems to work until I try to post.
Then I get a message HTTP 405 - Resource not allowed. Is there something
else I need to do?

Thanks!
Sean

Ronx said:
This will work with FP extensions (and all other form handlers)

Place a hidden field in the form

<inp type="hidden" name="ipdte" value="">

and the following script at the end of the form (just before the </form>
tag.

<script type="text/javascript">
var ipDate;
ipDate = "ipaddress + date" //code to set value for ipAddress and date.
document.forms[0].ipdte.value = ipDate;
</script>

where [0] is the count of the form on the page, starting from 0.
--
Ron Symonds (Microsoft MVP - FrontPage)
Reply only to group - emails will be deleted unread.


Massey in Binghamton said:
I've created a survey web with multiple pages. Each page will be submitted
separately and the pages will be connected by way of a unique id number. I
created the id number using a Java script that combines the participant's
remote ip and the date and time. Unfortunately, I can't figure out how to
get that variable from the Java script back into Frontpage so I can
include
it as a hiddle variable that can be submitted with the rest of the form
variables. Any suggestions?
Thanks!!
 
R

Ronx

Can you post a link to the published page?

--
Ron Symonds (Microsoft MVP - FrontPage)
Reply only to group - emails will be deleted unread.


Massey in Binghamton said:
Ronx,

Thanks for all the advice. Everything seems to work until I try to post.
Then I get a message HTTP 405 - Resource not allowed. Is there something
else I need to do?

Thanks!
Sean

Ronx said:
This will work with FP extensions (and all other form handlers)

Place a hidden field in the form

<inp type="hidden" name="ipdte" value="">

and the following script at the end of the form (just before the </form>
tag.

<script type="text/javascript">
var ipDate;
ipDate = "ipaddress + date" //code to set value for ipAddress and date.
document.forms[0].ipdte.value = ipDate;
</script>

where [0] is the count of the form on the page, starting from 0.
--
Ron Symonds (Microsoft MVP - FrontPage)
Reply only to group - emails will be deleted unread.


"Massey in Binghamton" <[email protected]>
wrote
in message news:[email protected]...
I've created a survey web with multiple pages. Each page will be
submitted
separately and the pages will be connected by way of a unique id
number. I
created the id number using a Java script that combines the
participant's
remote ip and the date and time. Unfortunately, I can't figure out how
to
get that variable from the Java script back into Frontpage so I can
include
it as a hiddle variable that can be submitted with the rest of the form
variables. Any suggestions?
Thanks!!
 

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