Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit replacement. 1

Status
Not open for further replies.

camilo

MIS
May 16, 2000
10
0
0
MX
Visit site
I want to know if I can replace the function of a submit button with something that's not visible like a hidden button but that I can activate thru scripting, or how can I totally hide the submit button and retain the functionality of it.
 
i think you can use <br>- either the form.submit property (or form.onsubmit() event ???? you'll have to check) <br>- or a button that calls any fuction you want to ( &lt;input type='button' value='click me' onclick='javascript:anything()'&gt; instead of &lt;input type='submit' ...&gt; )<br><br><br>
 
iza's right. Kinda like this:<br>&lt;FORM onSubmit=&quot;mySubmitFunction()&quot;&gt;<br><br>This will be invoked when the user presses the enter button. Unfortunately, non-JavaScript browsers will never be able to access this, but you might be able to hide your submit button in a &lt;NOSCRIPT&gt; tag. Also, I think certain versions of Netscape do not treat pressing the enter tag as submitting, so the onSubmit call will never be met. I'm not sure, though... good luck :eek:) <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
hmm looks interesting, any way possible to make it pass the objects in the form as parameters to the Javascript? <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
For Javascript-enabled browsers, you would simply call<br>document.formname.submit() to submit the form based on just about any action you want.<br><br>For example if you have a form named &quot;theForm&quot; anywhere in your page, you could somewhere else place &lt;a href=&quot;#&quot; onmousover=&quot;document.theForm.submit()&quot;&gt;&lt;img src=&quot;myimage.jpg&quot;&gt;&lt;/a&gt;<br><br>Or even &lt;body onclick=&quot;document.theForm.submit()&quot;&gt;<br><br>Cool?<br><br>As to the last request, I remember somewhere seeing that you can use the eval() method on the location string to get variables sent with the page request. I'm not sure it would work with the POST method, though.
 
I used document.myForm.submit() in one of my javascript function. I got 'the object doesn't support this property or method' error from IE 5.5. Any comments? Thanks
 
xchen
you should start a new thread in this forum - you'll get more chances to be read and answered, as this thread is an old one - what's more, you're a bit off topic (i think your error doesn't come from the submit() function but from the document.myform that is actually not referring to a form)
so, to get a quicker and more accurate answer, i suggest you to start a new thread here (and please include some part of your code : where the function is called, and where the form is named; so that we can fully help you)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top