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
235 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need help editing script 3 72
asp syntax 3 49
ASP Focus problem 3 60
contractual requirements for app hosting 3 102
Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
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…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now