473,473 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2441

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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.