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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submit 2 forms at once?

Status
Not open for further replies.

sonicsnail

Technical User
Nov 10, 2001
48
IN
Hi all...

I'll try to keep this clear... Read carefully!

I have a page that updates a db using ASP. This will be used by the enduser.

I have another page (different server) that sends SMS messages (this one I have no control over - I can only submit to the CGI - username and pw are fields of the form) - I can't allow the username/pw fields to be seen by the enduser.

Here's what I want to do...

I want to create my ASP page so it also submits a form to the CGI SMS page. I thought about recreating the SMS form with hidden fields, but the enduser should only see ONE submit button - so they won't be able to submit the hidden form.

Or can a submit button submit 2 forms?? (using JS?)

Plus I have the problem of the enduser seeing the "hidden" username/pw if they view source, then having full access to the SMS page - not an option!

I hope that makes sense!

any suggestions?

 
You could use JavaScript to send the two forms, then use script encoder to sort out your javascript (the average user won't know what is going on in the source) Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
any chance of an example - or maybe a tut or something I can learn from?

I don't know how to use JS to submit both forms, OR how to encode the source!

thanks, I really appreciate it.

Pete
 
Try this :

Code:
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
<!--
  document.write('<form name=&quot;form2&quot; action=&quot;url/cgi-bin/sms.cgi&quot; method=&quot;post&quot;>')
  document.write('  <input type=&quot;hidden&quot; name=&quot;username&quot; value=&quot;wotever&quot;>')
  document.write('  <input type=&quot;hidden&quot; name=&quot;password&quot; value=&quot;wotever&quot;>')
  document.write('</form>')
  function sendforms() {
    document.form2.submit()
    document.form1.submit()
  }
//-->
</script>

<form name=&quot;form1&quot; action=&quot;page.asp&quot; method=&quot;post&quot;>
  <input>
  <input>
  <input type=&quot;button&quot; value=&quot;go&quot; onclick=&quot;sendforms()&quot;>
</form>

All you would need to do is encode the source :

Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **
 
thanks - I'll read up on this.

cheers,

Pete.

(PS. anyone else with any input I'll be very grateful)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top