/    Sign up×
Community /Pin to ProfileBookmark

2 actions in single form, 1 submit button!!

Hey guys,

What I’m trying to do is integrate Sales Force (an account management program) into the code for the “guestbook” page of a website. Sales Force has code that sends the user’s information directly into it’s database, storing it as an account for the customer’s convenience.

So the problem is, I cannot figure out how to execute 2 actions in a single form, with only 1 submit button. Ideally, when the user
clicks the “submit” button, the information will be sent to the salesforce database, as well as print on the guestbook page as a comment.

the guestbook doesn’t go into a database, it goes into a flat-file format that is already on the server ([url]http://www.simplijthy.com/davepatten/guestbook/ardgb18.dat[/url])

So this is what I’ve got:

<form method=”post” action=”<?=$self?>”>
<form action=”https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8” method=”post”>
<input type=”hidden” name=”oid” value=”00D600000007CmQ” />

<input type=”text” name=”vname” size=”30″ maxlength=”70″ value=”<?=$_SESSION[‘name’]?>”>

<label for=”email”></label><input id=”email” maxlength=”80″ name=”email” size=”20″ type=”text” value=”<?=$_SESSION[’email’]?>”>

<label for=”city”></label><input id=”city” maxlength=”40″ name=”city” size=”20″ type=”text” /><br>

<textarea name=”vcomment” cols=”40″ rows=”7″ wrap=”virtual”><?=$_SESSION[‘comment’]?></textarea>

<input type=”text” name=”vsecc” size=”4″ maxlength=”4″>

<input type=”submit” name=”submit” id=”submit” value=”submit” />
<input type=”reset” value=”Reset”>
<input type=”button” value=”Back” onClick=”window.location='<?=”$self?page=$page”?>'”>
</form>

…if anyone can make any sense of this I will be so freakin happy haha thanks!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogFeb 04.2009 — The form can only point to one action. You could probably do clever things with JavaScript with an onsubmit() event, but that would fail if the user happens to have JavaScript disabled for any reason. I would probably instead have the action point to a PHP script that uses [url=http://www.php.net/curl]cURL[/url] to access the desired separate scripts.
Copy linkTweet thisAlerts:
@YelgnidrocFeb 05.2009 — Get the action page that receives your form to update the database as well as write to the guestbook file.
×

Success!

Help @south9border spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...