dstafford Posted September 3, 2008 Share Posted September 3, 2008 Just getting into html so forgive the simple question...Anyone know a way to work around the following:I have a script that adds up several fields on a simple html page. when I add a submit button to pass numerous variables to another rpage and database. The script stops running. Is here a way I can use a script that also needs to submit that data to an asp page?Thanks Link to comment Share on other sites More sharing options...
Kingy Posted September 3, 2008 Share Posted September 3, 2008 I'm not really familiar with asp to be honest but can I ask do you have an asp server set up?I noticed you said you were new to HTML so that's why I ask. Link to comment Share on other sites More sharing options...
Ingolme Posted September 3, 2008 Share Posted September 3, 2008 What's the code of your page? The problem could be anything. Link to comment Share on other sites More sharing options...
dstafford Posted September 3, 2008 Author Share Posted September 3, 2008 not using asp.net.... IIS web server which is set to handle asp pages. Using it to gather some simple data then transfer to database. That all works fine. I added a small java script to the program to offer some onscreen totals before the data is sent to the dtabase via the asp page and it does not work. If I remove the submit button the totals work fine. Link to comment Share on other sites More sharing options...
jeffman Posted September 3, 2008 Share Posted September 3, 2008 A submit button submits the form. That's its job. You can attach a click handler to the button also, but it's going to submit that form, and how the two conflicting instructions work out is (IME) unpredictable.What you want is to handle the submission part yourself. You can make your handler an onsubmit handler or just make your submit button a regular button (type="button"). Then the last part of your display function does something like myform.submit().Now, all that's going to happen FAST, so if you want your user to see something before the page goes away, you'll need to do something like this:var t = setTimeout (myform.submit, 5000);That creates a 5 second delay during which your user can see whatever you're displaying. You might want less. It's just an example. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.