1,105,352 Community Members

Need help with Posting data n opening the "SaveEntry,php" through submit button

Member Avatar
shruti.cs17
Newbie Poster
1 post since Sep 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I know this is kind of silly but I am getting confused and don't know where to add the OnSubmit function which is supposed to open the SaveEvent.php file (its in the www directory). As of now the code doesn't work. As in nothing happens when I click the submit button.

<body>
<form action="SaveEvent.php" method="post" target="hiddenFrame">
EventID: <input type="text" name="EventID" />
<br />
EventName: <input type="text" name="EventName" />
<br />
EventVenue: <input type="text" name="EventVenue" />
<br />
EventFrom: <input type="text" name="EventFrom"/>
EventTo: <input type="text" name="EventTo"/>
<br />
<input type="submit" onSubmit="SaveEvent.php" />
</form>
Member Avatar
mathieu89
Light Poster
37 posts since Nov 2010
Reputation Points: 14 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

At the moment you have a few things wrong. The form action should be SaveEvent.php . Im not sure what the hiddenframe is but get rid of it. You also don't need to have an onsubmit function because you already have the action in the form.

<form name="event" action="SaveEvent.php" method="POST">
...
<input type="submit" value="Save" />
</form>

Then all the variables have been posted to SaveEvent.php and you would simply do the following on the SaveEvent.php page to initialize them.

$id=$_POST['EventID'];
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: