...

View Full Version : Submit form multiple times



petey1705
07-21-2011, 04:45 PM
Hey everyone,

I'm having a problem with a project i'm working on.

We have a webpage setup to alpha page individual people with pagers at work. It is a simple form that submits to a php file on the pager server.

I am working on creating a script that submits a alpha-page to everyone at once.

There are about 120 different ppl in the company, I want the script to submit the form once for each persons pager.

I'm new to javascript but have alittle programming understanding.

This is what i have so far:

<html>
<head>
<title>Send a Page</title>
</head>
<body>
<center>
<form action="http://sendpage/pager/PageSend.php" method="POST">

<input type="hidden" name="ContactPagerNumberId[]" value="120">
<input type="hidden" name="PagemessageId" value="What are you doing?">
<input type="hidden" name="ScheduledDeliverydateId" value="2011-08-22">
<input type="hidden" name="ScheduledDeliveryTimeId" value="19:30:00">
<input type="hidden" name=ScheduledDeliveryAmPmId" value="selected">

<button style="width:140px; height:30px" type="submit" name="SEND">Submit</button>
</form>

</body>
</html>

The ContactPagerNumberId[] is the arbitrary value set to individual ppl's pagers.

I'm not sure where to place the javascript code at. It doesn't seem as hard as I'm making it out to be.

Any suggestions?

DanInMa
07-21-2011, 06:00 PM
best thing to do is add a checkbox on the form to indicate if the user wants to page all users or not.

then in your php procesing page, you write an if else statement that checks if this value is true and if so pages all users else it does it's normal function.

sunfighter
07-21-2011, 06:13 PM
<center> is depreciated, use <div style="text-align: center;"> and close the tag:

<html>
<head>
<title>Send a Page</title>
</head>
<body>
<div style="text-align: center;">
<form action="http://sendpage/pager/PageSend.php" method="POST">

Pager Number:<input type="text" name="ContactPagerNumberId[]"><br>
Page Message:<input type="text" name="PagemessageId"><br>
<input type="hidden" name="ScheduledDeliverydateId" value="2011-08-22">
<input type="hidden" name="ScheduledDeliveryTimeId" value="19:30:00">
<input type="hidden" name=ScheduledDeliveryAmPmId" value="selected">

<button style="width:120px; height:30px" type="submit" name="SEND">Page All</button>
<button style="width:120px; height:30px" type="submit" name="SEND">Submit</button>
</form>
</div>
</body>
</html>

It's the PageSend.php file that will do the magic. No need to send the submit multiple times.

May I also suggest a list of people by name that can be selected and have that selection send the page. 120 people's names should fit on the screen easily.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum