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

Home Posts Topics Members FAQ

Form Submit Problem

63 New Member
function formsubmit(formname)
{
alert(formname);
var submitform = document.getElementById(formname);
alert(submitform);
submitform.submit();
}

I use this function to submit many forms from different pages, now for most pages the second alert returns an ObjectHTML... but for one particular form the first alert pops the name of the form properly but the second alert returns NULL can you tell and needless to say the particular page(form) does not work.

Could someone tell me whts happening??
Jul 9 '07 #1
3 1388
acoder
16,027 Recognized Expert Moderator MVP
Show the form HTML and how you are calling it.
Jul 9 '07 #2
amolbehl
63 New Member
printf("<form name=makeqset id=makeqset method=post action=\"%s\">\n", $this->show_cb());
printf(" <table class=\"showobject_gq\">\n");
printf(" <tr class=objectrow>\n");
printf(" <td style=\"width:40%%\">\n");
.....
.....
.....
printf(" <input class=button type=button value=\"Save & Close\" onclick=\"savechanges('makeqset')\">\n");
printf(" </td>\n");
printf(" </tr>\n");
printf(" </table>\n");
printf("</form>\n"


Now the Javascript code is

function savechanges(formname)
{
var allqs = document.getElementById("allqs");
var selectedqs = document.getElementById("selectedqs");

selectedqslen = selectedqs.length;
// Check if the inviteelist is not empty.
if(selectedqslen <=0)
{
alert(" Please select a quiz question before Saving");
return 0;
}

for( i=0; i< selectedqslen ; i++)
{
alert(selectedqslen);
selectedqs.options[i].selected = true ;
}
alert(formname);
var sform = document.getElementById(formname);
alert(sform);
sform.submit();
//document.forms['makeqset'].submit();
}

the alret(sform) is returning NULL. Thanx for looking into it.
Jul 9 '07 #3
amolbehl
63 New Member
Hey

I was able to figure out the problem ... thanx a lot
Jul 9 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: T.E. | last post by:
Hi all, I'm a newbie in php. I encounter a problem with php form that has only one textfield. If I click on the submit button, the form works fine. However, when I press 'enter', the form...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
4
by: jwlum | last post by:
I have the following problem under Internet Explorer only: 1. User fills out form data (myform.php) and clicks a button that fires myFunction() 2. myFunction() spawns a "hello, world" popup page...
16
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the...
4
by: Greg Scharlemann | last post by:
I'm trying to setup a dyamic dropdown list that displays a number of text fields based on the selected number in the dropdown. The problem I am running into is capturing the data already entered...
26
by: Jerim79 | last post by:
I need to create a form that takes a number that the user enters, and duplicates a question the number of times the user entered. For instance, if the customer enters 5 on the first page, when...
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
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.