Code for button to refresh page after inserting data in sql db

This is a discussion on "Code for button to refresh page after inserting data in sql db" within the JavaScript Forum section. This forum, and the thread "Code for button to refresh page after inserting data in sql db are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 27th, 2007, 02:45
New Member
Join Date: Apr 2006
Location: ILLINOIS
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Code for button to refresh page after inserting data in sql db

I'm not sure if this is the right forum but I'm going to start here...

I am creating an application where when the user has answered all questions and hit the 'add new item' button, the data is inserted into the database and the page will refresh so the user can fill it in again for the next item on the quote. I need this to happen continuously until they hit the 'finish' button which will then insert the data and also send the email. I have everything working except for the 'add new item' button. Can anyone help me understand how to have this button insert the data into the database and refresh for the next entry?

Here's my insert statement...

Code: Select all
strSQL = "INSERT into cyl.dbo.Quote_Requirements (" _
           & "Cust_ID, " _
           & "qty_per_ord, " _
           & "qty_per_yr, " _
           & "t_price, " _    
           & "quoted, " _
           & "q_num, " _
           & "built, " _
           & "Serial_num, " _
           & "model_num,  " _
           & "spec_mods, " _
           & "design_built, " _
           & "match_design, " _
           & "mfg_name, " _
           & "service, " _
           & "series, " _
           & "bore, " _
           & "rod_dia, " _
           & "wk_stroke, " _
           & "stroke_tol_plus, " _
           & "stroke_tol_neg, " _
           & "lholding, " _
           & "hyd_shock, " _
           & "low_friction, " _
           & "press_rise, " _          
           & "dbl_rod, " _
           & "press_rod_end, " _
           & "press_cap_end, " _
           & "s_extend, " _
           & "s_retract, " _
           & "rod_end_type, " _
           & "rod_end_size, " _
           & "rod_end_loc, " _
           & "cap_end_type, " _
           & "cap_end_size, " _
           & "cap_end_loc, " _
           & "bolt_on, " _
              & "bom_adder, " _
           & "bom_spec, " _
           & "integral, " _
           & "icm_adder, " _
           & "icm_spec, " _
           & "fluid_type, " _
           & "oper_temp, " _
           & "pseal_type, " _
           & "rseal_type, " _
           & "mtg_styles, " _
           & "mtg_mode, " _
           & "load_guide, " _
           & "cush_cap, " _
           & "cush_head, " _
           & "rod_speed, " _
           & "load_push, " _
           & "load_pull, " _
           & "cycle_rate, " _
           & "cycle_duty, " _
           & "side_load, " _
           & "rod_position, " _
           & "environment, " _
           & "sgl_act, " _
           & "pre_load, " _
           & "press_avail, " _
           & "final_load, " _
           & "spec_matl, " _
           & "spec_paint, " _
           & "draw_num, " _
           & "rev_num, " _
           & "elec_req, " _
           & "transducer,  " _
           & "trans_comments, " _
           & "thaz_env, " _
           & "tnema_enc, " _
           & "TnemaRate, " _
           & "safe_trans, " _
           & "AnaOut, " _
           & "DigOut, " _
           & "interrogation, " _
           & "recirc, " _
           & "format, " _
           & "resolution, " _
           & "performance, " _
           & "opts, " _
           & "protocol, " _
           & "baud_rate, " _
           & "baud_res, " _
           & "switches, " _
           & "switch_comments, " _
           & "shaz_env, " _
           & "snema_enc, " _
           & "SnemaRate, " _
           & "safe_switch, " _
           & "ACSwitchLoc, " _
           & "DCSwitchLoc, " _
           & "connector, " _
           & "electron) " _
           & "values (" & SESSION("CustId") & ", ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
And here's the code for the button...

Code: Select all
 <div align="center">
<input type="button" onClick="modalWin2()"name="button" value="Attach Documents"><br><br>
<input type="submit" name="button" value="Add Another Item?" ?onClick="document.reload."?> This is where I have my question...what should I put in the onClick function????


<input type="submit" name="button" value="Finish" onClick="return validateRadioButton();">
<input type="reset" name="Reset" value="Clear">
</div>
</FORM>

Any help would be greatly appreciated.
Reply With Quote

Reply

Tags
insert, refresh

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop the browser refresh on clicking the webbrowser's refresh button ? camarun20 JavaScript Forum 3 Mar 18th, 2008 23:04
example of Inserting and Retrieving data from xml file hanusoft Classic ASP 1 Sep 25th, 2007 17:21
How does a page refresh? flox74 Web Page Design 8 May 8th, 2006 19:41
inserting data to mysql db Tim356 PHP Forum 1 May 6th, 2005 04:20
How to refresh XML data crashcup Other Programming Languages 3 Feb 6th, 2005 19:05


All times are GMT. The time now is 10:02.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43