473,394 Members | 1,865 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,394 software developers and data experts.

Javascript submit()

Ike
Oh I must be missing somethign so simple and stupid. I need to do a
submit() via an href, which I do (succesfully) in JavaScript in many other
pages with <a href="javascript:document.MyForm.submit();" For whatever
reason, I cannot get the following page to submit -- I have been looking at
this so long I cannot see it - though I know it;s somethign simple and
looking right at me! Can anyone please give this a cursory glance and point
out what must be my glaring oversight that I dont see here? Thanks, Ike
<html>
<head>
<title>GGForm Demo</title>

<LINK rel="stylesheet" type="text/css" href="lstyle.css">
<STYLE type="text/css">
a:hover{ color:#555555; }
</STYLE>
</head>

<body link="#777777" alink="#555555" vlink="#777777">

<table align="center" cellpadding=5 style="border:1px solid #CCCCCC;">
<tr><td>

<label class="label" for="">Guerrilla Grip UPs System</label><br><br>
<br><br><br>
<form name="leads" id="leads" action="/leads.php" method="POST"
style="margin:0">
<input type="hidden" name="uniqueId" id="uniqueId" class="text">
<input type="hidden" name="upcardkey" id="upcardkey" class="text">
<label class="selectlabel" for="associatekey">Associate serving this
customer</label><br>
<select name="associatekey" id="associatekey" size="1" class="select">
<option value="6">chip</option>
<option value="4">chris55</option>
<option value="7">dave</option>
<option value="3">daw91</option>
<option value="1">jol36</option>
<option value="5">rjl10</option>
<option value="2">rvince</option>
<option value="8">tom</option>
</select><br><br>

<input type="hidden" name="date" id="date" class="text">
<input type="hidden" name="time" id="time" class="text">
<label class="textlabel" for="sensor"
onClick="forms['leads'].sensor.select();">Sensor</label><br>
<input type="text" name="sensor" ..id="sensor" size="3" MAXLENGTH="3"
class="text"><br><br>

<label class="textlabel" for="heads"
onClick="forms['leads'].heads.select();">Number of persons in this
party</label><br>
<input type="text" name="heads" ..id="heads" size="3" MAXLENGTH="3"
class="text"><br><br>

<input type="hidden" name="upskey" id="upskey" class="text">
<label class="selectlabel" for="howdidyouhear">How did you hear about our
company?</label><br>
<select name="howdidyouhear" id="howdidyouhear" size="1" class="select">
<option value="12"> hf membership list 2004</option>
<option value="3">cold call</option>
<option value="11">distributor</option>
<option value="6">home builders</option>
<option value="10">justin</option>
<option value="1">market-high point</option>
<option value="8">mortgage companies</option>
<option value="9">other</option>
<option value="5">phone up</option>
<option value="2">pre-market-high point</option>
<option value="7">real estate</option>
<option value="4">referral</option>
</select><br><br>

<div class="hbuttons">
<a href="javascript:document.forms['leads'].reset();" value="Reset Form"
class="button" >Reset Form</a>
<a href="javascript:document.forms['leads'].submit();" class="button"
Submit Form</a>

</form>
</div>
<div style="clear: left;"></div>

</td></tr></table>
</body></html>
Jul 23 '05 #1
4 2657
Ike <rx*@hotmail.com> wrote:
Oh I must be missing somethign so simple and stupid. I need to do a
submit() via an href, which I do (succesfully) in JavaScript in many other
pages with <a href="javascript:document.MyForm.submit();" For whatever
reason, I cannot get the following page to submit -- I have been looking at
this so long I cannot see it - though I know it;s somethign simple and
looking right at me! Can anyone please give this a cursory glance and point
out what must be my glaring oversight that I dont see here?


I copied your code verbatim, loaded it into a browser, and it works for me
as-is. The reset and submit links both work. Obviously I don't have the
server-side components, but the submission does occur.

--
Jeremy | je****@exit109.com
Jul 23 '05 #2

Ike wrote:
Oh I must be missing somethign so simple and stupid. I need to do a
submit() via an href, which I do (succesfully) in JavaScript in many other pages with <a href="javascript:document.MyForm.submit();" For whatever reason, I cannot get the following page to submit -- I have been looking at this so long I cannot see it - though I know it;s somethign simple and looking right at me! Can anyone please give this a cursory glance and point out what must be my glaring oversight that I dont see here? Thanks, Ike <html>
<head>
<title>GGForm Demo</title>

<LINK rel="stylesheet" type="text/css" href="lstyle.css">
<STYLE type="text/css">
a:hover{ color:#555555; }
</STYLE>
</head>

<body link="#777777" alink="#555555" vlink="#777777">

<table align="center" cellpadding=5 style="border:1px solid #CCCCCC;"> <tr><td>

<label class="label" for="">Guerrilla Grip UPs System</label><br><br>
<br><br><br>
<form name="leads" id="leads" action="/leads.php" method="POST"
style="margin:0">
<input type="hidden" name="uniqueId" id="uniqueId" class="text">
<input type="hidden" name="upcardkey" id="upcardkey" class="text">
<label class="selectlabel" for="associatekey">Associate serving this
customer</label><br>
<select name="associatekey" id="associatekey" size="1" class="select"> <option value="6">chip</option>
<option value="4">chris55</option>
<option value="7">dave</option>
<option value="3">daw91</option>
<option value="1">jol36</option>
<option value="5">rjl10</option>
<option value="2">rvince</option>
<option value="8">tom</option>
</select><br><br>

<input type="hidden" name="date" id="date" class="text">
<input type="hidden" name="time" id="time" class="text">
<label class="textlabel" for="sensor"
onClick="forms['leads'].sensor.select();">Sensor</label><br>
<input type="text" name="sensor" ..id="sensor" size="3" MAXLENGTH="3"
class="text"><br><br>

<label class="textlabel" for="heads"
onClick="forms['leads'].heads.select();">Number of persons in this
party</label><br>
<input type="text" name="heads" ..id="heads" size="3" MAXLENGTH="3"
class="text"><br><br>

<input type="hidden" name="upskey" id="upskey" class="text">
<label class="selectlabel" for="howdidyouhear">How did you hear about our company?</label><br>
<select name="howdidyouhear" id="howdidyouhear" size="1" class="select"> <option value="12"> hf membership list 2004</option>
<option value="3">cold call</option>
<option value="11">distributor</option>
<option value="6">home builders</option>
<option value="10">justin</option>
<option value="1">market-high point</option>
<option value="8">mortgage companies</option>
<option value="9">other</option>
<option value="5">phone up</option>
<option value="2">pre-market-high point</option>
<option value="7">real estate</option>
<option value="4">referral</option>
</select><br><br>

<div class="hbuttons">
<a href="javascript:document.forms['leads'].reset();" value="Reset Form" class="button" >Reset Form</a>
<a href="javascript:document.forms['leads'].submit();"

class="button"
Submit Form</a>

</form>
</div>
<div style="clear: left;"></div>

</td></tr></table>
</body></html>


Maybe....

<a href="#null"
class="button"
onclick="document.leads.submit();return false;">Submit Form</a>

Jul 23 '05 #3
Ike

"Jeremy Nixon" <je****@exit109.com> wrote in message
news:11*************@corp.supernews.com...
Ike <rx*@hotmail.com> wrote:
Oh I must be missing somethign so simple and stupid. I need to do a
submit() via an href, which I do (succesfully) in JavaScript in many other pages with <a href="javascript:document.MyForm.submit();" For whatever
reason, I cannot get the following page to submit -- I have been looking at this so long I cannot see it - though I know it;s somethign simple and
looking right at me! Can anyone please give this a cursory glance and point out what must be my glaring oversight that I dont see here?


I copied your code verbatim, loaded it into a browser, and it works for me
as-is. The reset and submit links both work. Obviously I don't have the
server-side components, but the submission does occur.

--
Jeremy | je****@exit109.com


But it really is not submitting. There seems to be a 'submit' value that
goes into the form when you use a standard submit button, which is not
present in this type of form submission.

In my POSTed to form, I am (unfortunately using php) to see:
if (isset($_POST['submit'])){
//this executes if I use a standard submit button but NOT a
javascript-generated submission like:
<a
href="javascript:document.forms['leads'].submit();...</a>
}

-Ike
Jul 23 '05 #4
Ike <rx*@hotmail.com> wrote:
But it really is not submitting. There seems to be a 'submit' value that
goes into the form when you use a standard submit button, which is not
present in this type of form submission.


That's correct. A submit button with a "value" attribute creates a
key/value pair in the submitted data. No submit button, it won't be
there. Basically, don't look for it on the server side; you don't
need it for anything.

--
Jeremy | je****@exit109.com
Jul 23 '05 #5

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

Similar topics

6
by: Shaun Fleming | last post by:
I've been trying to make this simple script compatible across various browsers. It works for IE 6.0 and NS 7 but doesnt work with Opera (I have version 7.11). This is what is supposed to happen:...
2
by: Margaret Werdermann | last post by:
Hi all: I'm having a nasty time with a particularly difficult piece of code and was hoping someone might be able to help me. I have a FormMail form that originally worked perfectly. Then, I...
4
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
11
by: Brian D | last post by:
I have been searching for a while to find an answer to this and I must be searching on the wrong keywords. Below is a snippet of my form. There are other form items on it, but I need to submit...
21
by: Martin Eyles | last post by:
I am trying to get javascript to cause a page to post back. I have tried calling _doPostBack from my script, but generates an error "object expected". I think this is because the page's script...
10
by: ljlolel | last post by:
So.. I have a form that submits to an ASP.net site made in C-sharp. The ASP site is not mine, i do not have the server side code. When I submit from my form by pressing the Submit button, I get...
5
by: IchBin | last post by:
Not sure if I should post this to a javascript group or here. So I'll try here first since most here mix both in this group. I am trying to pass a php value into a JavaScript function that changes...
10
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
5
by: Rabel | last post by:
I am a flash designer so I dont know a whole lot about the javascript submit buttons (I may not even be describing it right sorry) but here is the code I am using. <IMG name="Checkout"...
14
by: Mtek | last post by:
Hi, We have a form defined with buttons like this: <a class="save_menu" href="javascript:document.Detail_Screen.action = 'savedata.php?screen=EDIT';document.Detail_Screen.submit();">Update</...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.