473,242 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,242 software developers and data experts.

I need to create a form on the fly

Requirement is to refresh a page in the form of a continual form
submittal (for server-side validation and action)

Here is the Javascript I came up with that I thought would do that:

<script type="text/javascript">
function generateForm() {
document.forms[0].elements[0].name = 'username';
document.forms[0].elements[0].type = 'hidden';
document.forms[0].elements[0].value = 'ppowell'
document.forms[0].elements[1].name = 'hasSubmittedLogin';
document.forms[0].elements[1].type = 'hidden';
document.forms[0].elements[1].value = '1'
document.forms[0].elements[2].name = 'id';
document.forms[0].elements[2].type = 'hidden';
document.forms[0].elements[2].value = '144'
document.forms[0].elements[3].name = 'submit';
document.forms[0].elements[3].type = 'hidden';
document.forms[0].elements[3].value = 'Login to view required forms'
document.forms[0].action = '/student/formlist.php';
document.forms[0].submit();
}

self.setTimeout('generateForm', 8000);
</script>

I keep getting the same error in both Firefox (Linux) and Konqueror:

document.forms[0] has no properties

Is there a way to refresh a page automatically causing continual form
auto-submit, required for continual server-side activity?

Thanx
Phil

May 3 '06 #1
5 2433

Lee wrote:
Phil Powell said:

Requirement is to refresh a page in the form of a continual form
submittal (for server-side validation and action)

Here is the Javascript I came up with that I thought would do that:

<script type="text/javascript">
function generateForm() {
document.forms[0].elements[0].name = 'username';
document.forms[0].elements[0].type = 'hidden';
document.forms[0].elements[0].value = 'ppowell'
document.forms[0].elements[1].name = 'hasSubmittedLogin';
document.forms[0].elements[1].type = 'hidden';
document.forms[0].elements[1].value = '1'
document.forms[0].elements[2].name = 'id';
document.forms[0].elements[2].type = 'hidden';
document.forms[0].elements[2].value = '144'
document.forms[0].elements[3].name = 'submit';
document.forms[0].elements[3].type = 'hidden';
document.forms[0].elements[3].value = 'Login to view required forms'
document.forms[0].action = '/student/formlist.php';
document.forms[0].submit();
}

self.setTimeout('generateForm', 8000);
</script>

I keep getting the same error in both Firefox (Linux) and Konqueror:

document.forms[0] has no properties

Is there a way to refresh a page automatically causing continual form
auto-submit, required for continual server-side activity?


When you submit a form, the server sends back a new page.
Just have it send back the form, instead of creating it in script.
--


This is the closest I could get to what you were talking about:

<form name="manualResetForm" method="POST"
action="/student/formlist.php">
<input type="hidden" name="username" value="ppowell">
<input type="hidden" name="hasSubmittedLogin" value="1">

<input type="hidden" name="id" value="144">
<input type="hidden" name="submit" value="Login to view required
forms">

<script type="text/javascript">
self.setTimeout('document.manualResetForm.submit', 8000);
</script>
<noscript>

Due to security constraints, once you click to view/download any of the
above-referenced forms, you must <input type="submit" name="submit"
value="click here"> before you are able to view/download any other
above-referenced form<br><br>
</noscript>

This never auto-submits the form and thus refreshes the page via FORM
post.

Phil

May 3 '06 #2

Phil Powell wrote:
Lee wrote:
Phil Powell said:

Requirement is to refresh a page in the form of a continual form
submittal (for server-side validation and action)

Here is the Javascript I came up with that I thought would do that:

<script type="text/javascript">
function generateForm() {
document.forms[0].elements[0].name = 'username';
document.forms[0].elements[0].type = 'hidden';
document.forms[0].elements[0].value = 'ppowell'
document.forms[0].elements[1].name = 'hasSubmittedLogin';
document.forms[0].elements[1].type = 'hidden';
document.forms[0].elements[1].value = '1'
document.forms[0].elements[2].name = 'id';
document.forms[0].elements[2].type = 'hidden';
document.forms[0].elements[2].value = '144'
document.forms[0].elements[3].name = 'submit';
document.forms[0].elements[3].type = 'hidden';
document.forms[0].elements[3].value = 'Login to view required forms'
document.forms[0].action = '/student/formlist.php';
document.forms[0].submit();
}

self.setTimeout('generateForm', 8000);
</script>

I keep getting the same error in both Firefox (Linux) and Konqueror:

document.forms[0] has no properties

Is there a way to refresh a page automatically causing continual form
auto-submit, required for continual server-side activity?


When you submit a form, the server sends back a new page.
Just have it send back the form, instead of creating it in script.
--


This is the closest I could get to what you were talking about:

<form name="manualResetForm" method="POST"
action="/student/formlist.php">
<input type="hidden" name="username" value="ppowell">
<input type="hidden" name="hasSubmittedLogin" value="1">

<input type="hidden" name="id" value="144">
<input type="hidden" name="submit" value="Login to view required
forms">

<script type="text/javascript">
self.setTimeout('document.manualResetForm.submit', 8000);
</script>
<noscript>

Due to security constraints, once you click to view/download any of the
above-referenced forms, you must <input type="submit" name="submit"
value="click here"> before you are able to view/download any other
above-referenced form<br><br>
</noscript>

This never auto-submits the form and thus refreshes the page via FORM
post.

Phil


I managed to redesign it, however, nothing happens upon <body
onLoad="manualReset()">

<script type="text/javascript">
<!--

function manualReset() {
self.setTimeout('document.manualResetForm.submit', 800);
}

//-->
</script>

However, absolutely nothing happens and I can't seem to figure out why
at this point.

Phil

May 3 '06 #3
ASM
Phil Powell a écrit :
Lee wrote:
Phil Powell said:

I keep getting the same error in both Firefox (Linux) and Konqueror:

document.forms[0] has no properties
did your page have a form (even empty) ?
Is there a way to refresh a page automatically causing continual form
auto-submit, required for continual server-side activity?
When you submit a form, the server sends back a new page.
Just have it send back the form, instead of creating it in script.
--

This is the closest I could get to what you were talking about:

<form name="manualResetForm" method="POST"
action="/student/formlist.php">
<input type="hidden" name="username" value="ppowell">
<input type="hidden" name="hasSubmittedLogin" value="1">

<input type="hidden" name="id" value="144">
<input type="hidden" name="submit" value="Login to view required
forms">

<script type="text/javascript">
self.setTimeout('document.manualResetForm.submit', 8000);


setTimeout('document.forms[\'manualResetForm\'].submit()', 8000);
This never auto-submits the form and thus refreshes the page via FORM
post.


Yes, that would have to submit to your formlist.php

--
Stephane Moriaux et son [moins] vieux Mac
May 4 '06 #4

ASM wrote:
Phil Powell a écrit :
Lee wrote:
Phil Powell said:

I keep getting the same error in both Firefox (Linux) and Konqueror:

document.forms[0] has no properties
did your page have a form (even empty) ?

Yes. The original as well as the generated formlist.php has a form at
all times, verified via alert(document.manualResetForm);

Is there a way to refresh a page automatically causing continual form
auto-submit, required for continual server-side activity?

When you submit a form, the server sends back a new page.
Just have it send back the form, instead of creating it in script.
--

This is the closest I could get to what you were talking about:

<form name="manualResetForm" method="POST"
action="/student/formlist.php">
<input type="hidden" name="username" value="ppowell">
<input type="hidden" name="hasSubmittedLogin" value="1">

<input type="hidden" name="id" value="144">
<input type="hidden" name="submit" value="Login to view required
forms">

<script type="text/javascript">
self.setTimeout('document.manualResetForm.submit', 8000);


setTimeout('document.forms[\'manualResetForm\'].submit()', 8000);
This never auto-submits the form and thus refreshes the page via FORM
post.


Yes, that would have to submit to your formlist.php


It doesn't do that, and it's supposed to do that.

CODE:

<script type="text/javascript">
function autosubmit() {
alert(document.forms[0]);
document.manualResetForm.submit();
}

function manualReset() {
self.setTimeout('autosubmit', 800);
}
</script>
Nothing happens, no alert is spawned, nothing at all. No errors of any
kind.

Phil
--
Stephane Moriaux et son [moins] vieux Mac


May 4 '06 #5

Phil Powell wrote:
ASM wrote:
Phil Powell a écrit :
Lee wrote:

>Phil Powell said:
>>
>>I keep getting the same error in both Firefox (Linux) and Konqueror:
>>
>>document.forms[0] has no properties


did your page have a form (even empty) ?


Yes. The original as well as the generated formlist.php has a form at
all times, verified via alert(document.manualResetForm);

>>Is there a way to refresh a page automatically causing continual form
>>auto-submit, required for continual server-side activity?
>
>When you submit a form, the server sends back a new page.
>Just have it send back the form, instead of creating it in script.
>
>
>--
This is the closest I could get to what you were talking about:

<form name="manualResetForm" method="POST"
action="/student/formlist.php">
<input type="hidden" name="username" value="ppowell">
<input type="hidden" name="hasSubmittedLogin" value="1">

<input type="hidden" name="id" value="144">
<input type="hidden" name="submit" value="Login to view required
forms">

<script type="text/javascript">
self.setTimeout('document.manualResetForm.submit', 8000);


setTimeout('document.forms[\'manualResetForm\'].submit()', 8000);
This never auto-submits the form and thus refreshes the page via FORM
post.


Yes, that would have to submit to your formlist.php


It doesn't do that, and it's supposed to do that.

CODE:

<script type="text/javascript">
function autosubmit() {
alert(document.forms[0]);
document.manualResetForm.submit();
}

function manualReset() {
self.setTimeout('autosubmit', 800);
}
</script>


Nothing happens, no alert is spawned, nothing at all. No errors of any
kind.

Phil
--
Stephane Moriaux et son [moins] vieux Mac

GOT IT!

<script type="text/javascript">
<!--

function autosubmit() {
document.manualResetForm.submit();
}

function manualReset() {
self.setTimeout('autosubmit()', 15000);
}

//-->
</script>

Basically I just plain guessed it as all of the Google references I
found apparently were syntactically wrong for what I needed to do!

Phil

May 4 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Button | last post by:
Hello all, I am really really desperate on what I should do, and I am asking for help from anyone in this newsgroup, here's the situation: I am creating a form that is being run on a server...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
10
by: Tom | last post by:
I am looking for some ideas for how to design the layout of the form for data entry and to display the data for the following situation: There are many sales associates. A sales associate can work...
7
by: Jack Addington | last post by:
I've got a fairly simple application implementation that over time is going to get a lot bigger. I'm really trying to implement it in a way that will facilitate the growth. I am first writing a...
0
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
5
by: Ming Yeung | last post by:
I was wondering if .NET had the equivalent of Frames, Global Objects, and most importantly DataModules like in Delphi?
13
by: PinkBishop | last post by:
I am using VS 2005 with a formview control trying to insert a record to my access db. The data is submitted to the main table no problem, but I need to carry the catID to the bridge table...
4
by: access baby | last post by:
i have a huge database based on date and time need to create different report we need to measure our work processes how many order received , order cancelled, completed and count of items completed...
1
by: javabeginner123 | last post by:
i have a java prob, and i have to solve it fast, but i'm just getting to know it, so plz help me solve it with full code completed, thanks so much. the prob is to create a monter fight and there is...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.