One button click call function more than once

I have a function I call from a button (onClick) which
inserts a record in mySQL via a PHP page. For some odd reason it
tends to insert more than 1 record. The extra records tend to be
duplicates of previous records. I do not know of SPRY is calling
the function multiple times, if stuff is cached somewhere and it
calls the cached data and the new data. I perform record INSERTS
and UPDATES on many web pages via PHP which get called thousands of
times but only this SPRY application is doing this. Please see my
code below.
Spry.Utils.loadURL function: (not that I want to use POST but
having an issue and so using GET)
function addcommentget(recordID)
var newcomment = document.form1.tescomment.value
Spry.Utils.loadURL("GET","addTEScomment.php?id="+recordID+"&comment="+newcomment,true,Upda teRecordCallback);
FORM code (where button and textarea are)
<form action="" method="post" name="form1">
Add Comment: </br>
<textarea name="tescomment" cols="40"
rows="2"></textarea></br>
<input name="addcomment" type="button" value="Submit
Comment" onClick="addcomment('{@id}');">
</form>
PHP code:
<?php session_start();
require_once('Connections/ppg_conn.php');
$id = $_GET['id'];
$comment = $_GET['comment'];
$user = $_SESSION['username'];
$sql = mysql_query("INSERT INTO
claimsmanager_tesedits_comments (Ticket_ID, Commenter_email,
Comment)
VALUES('$id', '$user', '$comment')
") or die (mysql_error());
?>
Is there anything you see that might cause this strange
behavior?
Thanks,
Lee

Spry.Utils.loadURL() only fires off a single request when you
call it.
Aside from the fact that your button calls "addcomment" as
opposed to the "addcommentget" function you show ;-), I don't see
any problem. Of course I'm not seeing the big picture, only what
you post. Do your data sets load URLs that actually perform DB
updates? Or are they pure DB query URLS?
I would put a line like this:
Spry.Debug.trace("AddCommentGet() triggered!");
in your addcommentget() function and see if you get a single
trace statement every time you press the button.
--== Kin ==--

Similar Messages

  • Use mouse click trigger option more than once?

    Hi, is there some way to use the "mouse click" trigger option more than once in the project? I am trying to build a menu button animate where the users click the (menu grid icon) once, and it transforms into the (x icon) and stays there until they click it again ONCE to change it back to the (menu grid icon). Other trigger actions aren't ideal, and I find that if I used the "double mouse click", the response gets a bit messy as clicking once would replay the whole sequence again. Thanks!

    At CreationComplete make a var as:
    button = -1;
    At click event of the button write:
    if (button == -1){
    sym.getSymbol("nmnmnmn").play("xicon");   // if you have a trigger in timeline to make this action that you want
    button++;
    else {
    sym.getSymbol("nmnmnmn").play("returnedicon");
    button = -1;
    Somehow like the above you'll have to do it.
    Or else you can use boolean , TRUE/FALSE

  • Can I call getRequestDispatcher more than once?

    All,
    Does a servlet allows getRequestDispatcher to be called than once?
    This is what I'm trying to do. While the server is processing data, I want to forward the user to a temporary page to display "Processing Data". Once
    the server got the result, then I want to forward the user to the separate page to display the data. But before forwarding to the second page, I flushBuffer() and reset() the response object. WHen reset(), I got IllegalStateException. How can I fix this? Here is my code snippet:
    1. Forward to first page:
    getServletContext().getRequestDispatcher(
    "/ProcessingNoticePage.jsp").forward(request, response);
    2. Flush out and reset:
    if(response.isCommitted())
    System.out.print("\nresponse is committed");
    response.flushBuffer();
    System.out.print("\nResetting response");
    response.reset();
    System.out.print("\nComplete reset");
    3. Forward to second page:
    getServletContext().getRequestDispatcher(
    pageName).forward(request, response);
    I got the IllegalStateException on the reset() in step #2. Thanks.

    What do you mean by refresh?
    The servlet is actually calling another object. THat objects call other objects to perform server side processing that talks over RMI/IIOP. This process might take more than 30 seconds. So in the mean time, I made the servlet forwarding to a temp page to let the user know that data is being processed. Once all the results are back, I set the result to the request obj. and then forward to another JSP page. This (second) JSP page will display the data.
    --kawthar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • When I Press F12, and click Home (link) more than once, the boarder grows

    when I pressed Home "twice", the boarder grew larger upwards, after a little while, it covered the menu bar.. I took the boarder out, but it began doing it with a white boarder.. Help?

    nevermind, fixed it!

  • Button/click box click more than once

    Hi, I'm hoping you guys can point out what I'm doing wrong...
    I have an image where the user can click on certain parts of
    it to display a callout. However, I want them to be able to click
    on the area of the image more than once if requried. I suppose you
    can say it's a bit like an image map.
    First I used click boxes to achieve this, then I tried using
    transparent buttons. However for both of these methods you can only
    click on each part once during playback. Clicking again does not
    show the callout.
    I thought about copying the contents to another slide and add
    a 'Reset' button the user could click on. This would move to the
    other slide, but this seems a bit on the 'clunky' side, so I
    thought there must be a setting or something really obvious that I
    have missed. I was unable to find the relevant informaiton in the
    help file or elsewhere in the forum, so if it does exist I would
    appreciate someone pointing me in the right direction.
    How can I allow the user to click on parts of the image more
    than once to show the callout?
    Thanks for your help,
    Liz

    Thanks for your reply Rick.
    I started the activity using rollovers, but I wanted the user
    to do something more definite than just hovering over each part of
    the image. So essentially, I want the rollover functionality but
    with the ability to click instead of just hovering the cursor over.
    I thought this would be easy!
    I've tried using both buttons and click boxes without any
    success. I ventured a little into slidelets, but I want the callout
    to appear in a very specific place and this did not appear to
    satisfy my requirements. The 'click to stick' sounds intriguing so
    I'll take a look into this, but I'm not convinced it's what I want.
    Any more suggestions are most welcome.
    Regards
    Liz

  • QuickTime DOM Events called more than once?

    I am in the process of writing code in JavaScript that will track the interaction on a embedded QuickTime video.
    function ew_addImage(v) {
    trackImg=new Image(1,1);
    trackImg.src=v;
    function ew_pauseTrk() {
    var imgStr='http://www.sldkfjsldfjk.com/200125/EWTRACKNEW_VINT?ewadid=751801&ewbust='ewbust'&eid=1078554&file=$VIDEO$&bw=56&vlen=3:00&vint=PAUSED';
    ew_addImage(imgStr);
    if (document.addEventListener)
    document.getElementById("mov1").addEventListener("qt_pause", ew_pauseTrk, false);
    Everything works correctly. I am able to see the image being called when I am looking at Wireshark. The problem is when I click pause more than once.. It seems like the QuickTime DOM Events can only be called once.. Is that true?
    Thanks

    -(void) flipToEditView {
    [self populateTheList]; // populate an array
    EditViewController *anEditVC = [[EditViewController alloc] initWithNibName:@"EditView" bundle:nil];
    [self setEditVC:anEditVC];
    [viewController.view removeFromSuperview];
    [self.window addSubview:[editVC view]];
    [anEditVC release]; }
    }<---- is this } matched elsewhere?

  • Performance... Why a function column in a view is executed more than once...?

    Why a function column created inside a view is executed more than once when called more than once?
    EXAMPLE:
    create or replace view aux1 as
    date_column,
    any_function(date_column) column1
    from any_table
    create or replace view aux2 as
    column1 c1,
    column1 c2,
    column1 c3
    from aux1
    select * from aux2
    It will execute 3 times the function any_function... logically the value will be the same for all columns...
    I understand why!... are 3 calls... but...
    Why not to create a "small" verification and if the function column was execute replace the second, the third... value? ... instead of execute 3, 4... times...
    tks
    Braga

    Actually, this is more than a performance issue. This is a consistency problem. If the function is NOT deterministic then you may get different values for each call which is clearly not consistent with selecting 3 copies of the same column from a row. Oracle appears to have fixed this in 9i...
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.2.0 - Production
    create view v1 as select dbms_random.value(1,100) r from dual;
    create view v2 as select r r1, r r2 from v1;
    select * from v2;
              R1           R2
              93           74
    Connected to:
    Oracle9i Enterprise Edition Release 9.0.1.3.0 - Production
    With the Partitioning option
    JServer Release 9.0.1.3.0 - Production
    create view v1 as select dbms_random.value(1,100) r from dual;
    create view v2 as select r r1, r r2 from v1;
    select * from v2;
              R1           R2
              78           78Richard

  • How to call the same query more than once with different selection criteria

    Hi,
    Please do anybody know how to solve this issue? I need to call one query with the fixed structure more than once with different selection criteria. For example. I have following data
    Sales organization XX
                         Income 2008  Income 2009
    Customer A       10                 20
    Customer B        30                  0
    Sales organization YY
                         Income 2008  Income 2009
    Customer A        20                5
    Customer B        50                10
    Now, I need this. At the selection screen of query, user fill variable  charakteristic "Sales organization" with interval  XX - YY, than I need to generate two separate results per sales organization, one for Sales Organization XX and the second for SO YYwhich will be displayed each on separate page, where result for SO YY will be dispayed under result for SO YY. Are there some options how to do it for example in Report Designer or WAD or with programming? In Report Designer is possible to use one query more than once, but I dont know how to force each query in RD to display result only for one Sales Organization, which will be defined in selection screen.
    Thank you very much
    J.

    Hello,
    thanks to all for cooperation. Finally we solved this issue with the following way..
    User fill appropriate SO on the selection screen, which is defined as range. This will resulte, that selected SO are listed in report below each othe (standard behavior). Required solution we achieved with the Report Designer, we set page break under each Result row of RD. This caused, that report is divided into required part per SO, which are stated each on separate page.
    J.

  • Calling thread.start() more than once concurrently

    Hi, I got a simple doubt that may feel awkward or absurd to people who are well versed in the java threading concepts. I just thought of it and as I couldn't get an easy answer I am posting this.
    Consider a class that implements the runnable interface. The run() method of the class is implemented with just a System.out.println(). If I make an instance of this class, say 't' in the main method and calling t.start() susequently twice or thrice; an illegal ThreadStateException will be thrown. The code snippet is as follows:
    ThreadTest t = new ThreadTest();
    t.start();
    t.start();
    It is understood that state of the thread object is changed to run state and so, if it is again started, it must be thrown. So if I put a Thread.sleep() inbetween these two subsequent calls assuming that the main method thread will be sleeping. So there is sufficient time for the first thread to terminate and then only the second will start - still the same exception is being thrown. I tried putting the synchronized qualifier for run too, still no effect - the same only happening. Why the java thread object is made in such a way that once the thread changes it state from Runnable to Running and then finally to dead state, it can be restated back to Runnable state, such that the start() method can be called again. Is it possible or not? Please post your comments.

    As ejp says you can't start a thread more than once - even if it has already terminated after the first start.
    By making threads a one-shot it simplifies reasoning about them: you don't have to wonder whether a second start() will work or not, depending on whether the thread has completed its first "incarnation". It also makes it easier to ensure thread resources are reclaimed. It also avoids semantic issues like whether anything about the thread is "carried over" across incarnations.
    This might seem a limitation but there are many ways around it - simply don't let the thread terminate. Whatever control structure you would enforce by re-starting the thread can be emulated without letting the thread terminate in between "executions".

  • WDDOMODIFYVIEW and WDDOPOSTPROCESSING is called more than once!

    Hello everybody,
    maybe someone can help me. Our WDA application consist of 5 Components. One main and 4 components embedded in it. We instantiate the components in the WDDOINIT of the main component and use them between themselves.
    I suppose that's the reason that the events in the views and componentcontrollers of each component is called so often.
    With a break point in a WDDOMODIFYVIEW an the debugger I find out that the  HANDLE_REQUEST methos from the CL_WDR_CLIENT_ABSTRACT_HTTP  class is startet also more than once.
    1.  if m_ucf is not bound -> yes and  m_request_type = suspend
    2.  if m_ucf is not bound -> initial and  m_request_type = suspend
    3.  if m_ucf is not bound -> initial and  m_request_type = suspend
    4.  if m_ucf is not bound -> initial and  m_request_type = refresh
    Maybe someone has expierence with it an can give a hint or explanations for this.
    I hope so
    Thanks for any answer
    Best regards
    Christian Breitenbach

    hi christian.......
         a wddomodifyview view method will be called even if there is a little change in your view. it will b e called more times than your normal pbo in a dynpro application. the wddoinit will be called only before the view is loaded... but the modify willbe called even for popups nad any event.
    ---regards,
       alex b justin

  • Play audio more than once on a button

    I have a need to configure the audio placed on the success status of the button to play more than once.  My users may need to hear it again but when clicking it the second time the only thing you hear is the click sound, not the audio.  I am using Captivate CS5 and have it set to infinite. 
    Thanks for any assistance! 

    Hi there
    I seem to make it work as follows:
    Configure a Success caption for the button that is transparent and has no text. Then assign the desired audio clip to the caption.
    Now configure a simple Advanced Action that is a Standard action of Assign. Assign the variable rdcmndGotoFrame with rdinfoCurrentFrame. Assign this action to the Button. This keeps the slide from progressing when the button is clicked.
    In my test, the audio played over and over without fail. The only down-side is if you repeatedly click the button too soon. Sometimes you would get just a click. But if you paused briefly between clicks, things sort of "reset" and the audio consistently played.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Method called more than once - and dies with EXC_BAD_ACCESS error

    Hi,
    In my app, I have 4 views with their respective viewControllers. In the appDelegate.m, I provide methods that allows to switch to any of these views. Following is code for switching to the editView:
    -(void) flipToEditView {
    [self populateTheList]; // populate an array
    EditViewController *anEditVC = [[EditViewController alloc] initWithNibName:@"EditView" bundle:nil];
    [self setEditVC:anEditVC];
    [viewController.view removeFromSuperview];
    [self.window addSubview:[editVC view]];
    [anEditVC release]; }
    The view is not switched - and moreover, this method is called more than once; and the app dies with EXCBADACCESS!
    2009-08-23 14:54:40.648 iNotate[2128:20b] Album (before): x= 0 y=20 width=320 height=460
    2009-08-23 14:54:40.653 iNotate[2128:20b] Album (after): x= 0 y= 0 width=320 height=480
    warning: Couldn't find minimal bounds for "_sigtramp" - backtraces may be unreliable
    (gdb) bt
    #0 -[iNotateAppDelegate flipToEditView] (self=0x523690, _cmd=0x9563) at /Users/sam/MY_FILES/iPhone Apps/app/Classes/iNotateAppDelegate.m:116
    #1 0x00008661 in -[FirstView editAction] (self=0x546a30, _cmd=0xac94) at /Users/sam/MY_FILES/iPhone Apps/app/FirstView.m:25
    #2 0x30a4eee6 in -[UIApplication sendAction:to:from:forEvent:] ()
    #3 0x30ab0d36 in -[UIControl sendAction:to:forEvent:] ()
    #4 0x30ab11fe in -[UIControl(Internal) _sendActionsForEvents:withEvent:] ()
    #5 0x30ab0544 in -[UIControl touchesEnded:withEvent:] ()
    #6 0x30a67917 in -[UIWindow sendEvent:] ()
    #7 0x30a56fff in -[UIApplication sendEvent:] ()
    #8 0x30a561e0 in _UIApplicationHandleEvent ()
    #9 0x31565dea in SendEvent ()
    #10 0x3156840c in PurpleEventTimerCallBack ()
    #11 0x94a713c5 in CFRunLoopRunSpecific ()
    #12 0x94a71aa8 in CFRunLoopRunInMode ()
    #13 0x31566600 in GSEventRunModal ()
    #14 0x315666c5 in GSEventRun ()
    #15 0x30a4eca0 in -[UIApplication _run] ()
    #16 0x30a5a09c in UIApplicationMain ()
    #17 0x000027e8 in main (argc=1, argv=0xbffff068) at /Users/sam/MY_FILES/iPhone Apps/app/main.m:14
    Current language: auto; currently objective-c
    (gdb) continue
    2009-08-23 14:54:55.885 iNotate[2128:20b] >>>>>>>>>>>>>>>>>> populateTheList
    (gdb) bt
    #0 -[iNotateAppDelegate flipToEditView] (self=0x523690, _cmd=0x9563) at /Users/sam/MY_FILES/iPhone Apps/app/Classes/iNotateAppDelegate.m:116
    #1 0x00008661 in -[FirstView editAction] (self=0x5457b0, _cmd=0xac94) at /Users/sam/MY_FILES/iPhone Apps/app/FirstView.m:25
    #2 0x30a4eee6 in -[UIApplication sendAction:to:from:forEvent:] ()
    #3 0x30ab0d36 in -[UIControl sendAction:to:forEvent:] ()
    #4 0x30ab11fe in -[UIControl(Internal) _sendActionsForEvents:withEvent:] ()
    #5 0x30ab0544 in -[UIControl touchesEnded:withEvent:] ()
    #6 0x30a67917 in -[UIWindow sendEvent:] ()
    #7 0x30a56fff in -[UIApplication sendEvent:] ()
    #8 0x30a561e0 in _UIApplicationHandleEvent ()
    #9 0x31565dea in SendEvent ()
    #10 0x3156840c in PurpleEventTimerCallBack ()
    #11 0x94a713c5 in CFRunLoopRunSpecific ()
    #12 0x94a71aa8 in CFRunLoopRunInMode ()
    #13 0x31566600 in GSEventRunModal ()
    #14 0x315666c5 in GSEventRun ()
    #15 0x30a4eca0 in -[UIApplication _run] ()
    #16 0x30a5a09c in UIApplicationMain ()
    #17 0x000027e8 in main (argc=1, argv=0xbffff068) at /Users/sam/MY_FILES/iPhone Apps/app/main.m:14
    (gdb) continue
    2009-08-23 14:55:22.493 iNotate[2128:20b] >>>>>>>>>>>>>>>>>> populateTheList
    Program received signal: “EXCBADACCESS”.
    (gdb) continue
    What's happening here?
    Sam!

    -(void) flipToEditView {
    [self populateTheList]; // populate an array
    EditViewController *anEditVC = [[EditViewController alloc] initWithNibName:@"EditView" bundle:nil];
    [self setEditVC:anEditVC];
    [viewController.view removeFromSuperview];
    [self.window addSubview:[editVC view]];
    [anEditVC release]; }
    }<---- is this } matched elsewhere?

  • Can the same partner function be entered in the sales order more than once.

    Hi
    I know that as per standard same partner function cannot be entered more than once in Sales order.
    If somebody has tried ways to do this please share.
    THanks
    Alags

    Yes. You can have multiple Ship to Party, Bill to Parrty & Payer in Sales Order. But Sold to Party will have to Unique & single.
    This functionality of having multilpe Partners is widely used & just follow as Deepak suggested above & you too can have multiple Partners of same type in single Sales Order.
    But there has to be a strong Business case in doing so... say different Ship tp Party for different line items in Sales Order or different BIll to Party for some line Items in Sales Order.
    Hope this helps,
    Thanks,
    JIgnesh Mehta

  • Have to click on firefox icon more than once to start the programme

    Sometimes I have to click on Firefox icon more than once to start the programme. Multi-clicking on the icon does not always start multiple windows ie the programme just isn't starting sometimes on 1st click.
    Firefox always opens when using a hyperlink in an email, document etc.
    Have tried creating a new quick launch & also re-installing.
    Happens on two PCs - 1x Vista & 1x XP
    All help is appreciated :)

    First let me disclose that I am not an expert nor even much less. However I used to have this slow as a turtle opening of FF until I got rid of my antivirus software which at the time was Avast. I switched to Microsoft Security Essentials and have had no problems since. FF loads in 3 to 4 seconds!

  • I have 2 problems with Mail. I cannot address an email to more than one recipient. And I receive some emails more than once.

    I have 2 problems with Mail. I cannot address an email to more than one recipient. And I receive some emails more than once. Can you please help?

    Restart your Mac. See if that makes a difference.

Maybe you are looking for

  • Creating Non-Repeating fields

    Hello all, I am creating a query that lists a bunch of student ID's and their schedules. However, the ID's of students should only show on the first row of thier schedule. I've figured out a way to do it with the Lag function, but I was wondering if

  • Duplicate IP address detected in WCS

    Hi to Cisco Support Community, I would like to verify some questions regarding our network setup for wireless devices. We have here in our client a 5508 WLC version 6.0.196.0 and WCS version 7.0.164.0 using windows platform. My concern is that there

  • Images in Emails

    I have a strange one, I used to be able to see images within my emails, but now I am getting a little blue question mark. It seems to be mainly on my imap account for 1and1 but it sometimes appears on my .me account too? Anyone else had this?

  • HotSpot JVM InternaL Error when running on Mac OS X

    I am getting the following error when running a Java process on Mac OS X 10.1.3. This occurs after runing the process for a few hours. What could be the probable causes for the same. The error message is given below: # HotSpot Virtual Machine Error,

  • Need a FM to add report to a role in the transaction PFCG

    Hi , I need to find a FM which would add a BW  REPORT to a role in the transaction PFCG. Regards , Harshit Rungta