Link to home
Start Free TrialLog in
Avatar of spraocs
spraocs

asked on

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
Avatar of Big Monty
Big Monty
Flag of United States of America image

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
Avatar of spraocs
spraocs

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of spraocs

ASKER

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