Solved

What are vbs.asp files? I don't find any results when I try to google info about this.

Posted on 2014-04-02
5
238 Views
Last Modified: 2014-04-06
I feel ashamed to say that I don't know what is vbs.asp file after using it successfully for more than 4 years. I couldn't find any information about.
The main issue is when I try to jQuery validate a form before submit and then go to the vbs.asp file to execute the code behind (that is what I understand it as all these days), the control doesn't go there.

Here is the description of the probloem.
---
mypage.asp has the include file mypage.vbs.asp with the business logic and after the successful execution of that code, mypage.vbs.asp has a response.redirect to mynextpage.asp.

I am trying to include a jQuery validation on mypage.asp before form submit, But, the control won't go to mypage.vbs.asp. If I specify mynextpage.asp in mypage.asp form action, the control goes there but, without executing the logic in mypage.vbs.asp.
---
How do I resolve this?

Thanks
spraocs
0
Comment
Question by:spraocs
  • 2
  • 2
5 Comments
 
LVL 33

Expert Comment

by:Big Monty
ID: 39973906
That page you're describing isn't any kind of special file,  it's just an asp file that the original developer named myfile.vbs.asp (which is an odd name given the two periods in the name)  

If you post the code for the two files we may be able to help you more
0
 
LVL 1

Author Comment

by:spraocs
ID: 39973987
Thanks for the information. Also, I am sorry for partially mis-firing the problem description..

I was experimenting with a few different blocks of jQuery code and some of the code was not commented and was creating confusion.

Now the jQuery before submit executes properly and the control goes to .vbs.asp file and the mynextpage.asp appears properly.

However, now the problem seems to be in the jQuery code.

I am using the following jQuery code to show a mandatory message to the user before submitting the form. The code executes and the message is shown, but, before user can click the ok button on the message window it is going away and the mynextpage.asp is appearing. I want that message box to stay until the user clicks OK button on the message box and then proceed to mynextpage.asp.

Can anyone help me with the fixing / fine-tuning this code?


<script>
$(function(){
    // Dialog box    
    $('#my-dialog').dialog({
        autoOpen: false,
        width: 300,
        modal: true,
        resizable: false,
        buttons: {
            "OK": function() {
                $(this).dialog("close");
                document.claimapp.submit();
            }
        }
    });
    $('form#claimapp').submit(function(e){        
        e.preventDefault();
        $('#my-dialog').dialog('open');
    });
});
</script>

Open in new window


Thanks
spraocs
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39974119
Can you create a very short sample test case.  We don't need the 1000 lines of code, just the important information.  As example, I created a short test based on what you have http://jsbin.com/sozofogi/1/edit?html,js,output and it seems to work.  

<!DOCTYPE html>
<html>
<head>
<link href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<div id="my-dialog">
  ok
  </div>
 
  <form id="claimapp">
  <fieldset>
    <label for="name">Name</label>
    <input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all">
    <button id="submit" type="submit">Submit</button>
  </fieldset>
  </form>

 
</body>
</html>

Open in new window

$(function(){
    // Dialog box    
    $('#my-dialog').dialog({
        autoOpen: false,
        width: 300,
        modal: true,
        resizable: false,
        buttons: {
            "OK": function() {
                $(this).dialog("close");
                document.claimapp.submit();
            }
        }
    });
    $('form#claimapp').submit(function(e){        
        e.preventDefault();
        $('#my-dialog').dialog('open');
    });
});

Open in new window

0
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39980285
I think you need to change

    $('form#claimapp').submit(function(e){        
   
to the mechanism that opens the dialog box, whether it's a button or a function call from something else.  It's going to your next page because you're using the submit event and the user doesn't have time to tell it to proceed or not
0
 
LVL 1

Author Closing Comment

by:spraocs
ID: 39981328
I came to post here my solution and I see that Big Monty's reply is somewhat matching with what I have done.

I did not use the Submit button for the 'mechanism'. Instead, I removed the type="submit" for the input tag so it becomes only a click action so I can control the flow and loaded the function with the dialog.

Here is the code for the function.

$(function(){
    //var confirmed = false
    // jQuery UI Dialog    
    $('#jq-dialog').dialog({
        autoOpen: false,
        width: 400,
        modal: true,
        resizable: false,
        buttons: {
            "OK": function() {
                confirmed = true;
                $(this).dialog("close");
                document.claimapp.submit();
            }
        }
    });
    $('#claimsubmit').click(function(){
        $('#jq-dialog').dialog('open');
    })
});

Open in new window


Thanks for sharing the thoughts.

spraocs
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Video on my site 4 74
How to show result of a NULL value at random? 33 57
Display first 3 lines of text from database field, vbscript asp 4 60
Server Timeout with Loop 6 52
      Install BugTracker on Windows 2008 server Step 1:  Install windows 2008 server 32 bit OS and configure IIS. Step 2:  Install SQL server ( SQL server 2005 or SQL server 2005 Express edition. The installer for 2008  version isn’t very f…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question