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
245 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 53

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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

717 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