By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,058 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,058 IT Pros & Developers. It's quick & easy.

Javascript submit()

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.