Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

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

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
spraocs
Asked:
spraocs
  • 2
  • 2
1 Solution
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
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
 
spraocsAuthor Commented:
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
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
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
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
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
 
spraocsAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now