Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Submit form multiple times

    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:
    Code:
    <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?

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    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.

  • #3
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,205
    Thanks
    23
    Thanked 605 Times in 604 Posts
    <center> is depreciated, use <div style="text-align: center;"> and close the tag:
    Code:
    <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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •