Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

add if statement

Posted on 2012-03-30
2
Medium Priority
?
257 Views
Last Modified: 2012-03-30
want to have in my jquery if integer < than 99 then do nothing else popup. like to add this to my syntax.

 function test(txt, id) {

        $("#dialog:ui-dialog").dialog("destroy");
        $("#dialog-form").html('You are adding a quantity of ' + txt + ', is this quantity correct?');
        $("#dialog-form").dialog({
            height: 120,
            width: 300,
            modal: true,
            buttons: {
                Yes: function() {
                   
                   // document.getElementById('ifrm').src = document.getElementById('ifrm').src;
                $(this).dialog("close");
              //  __doPostBack('UpdatePanel1', '');
                   
                },

                No: function() {
                    // $("#" + id).val($("#" + id).data("prevvalue"));
                document.getElementById('ifrm').contentWindow.text(id);

                    $(this).dialog("close");
                }

            }
        });
0
Comment
Question by:Seven price
2 Comments
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 1600 total points
ID: 37787797
before this line
$("#dialog-form").dialog({

add this line

txt = parseInt(txt);
if ( txt < 99 )
{
   return false;
}
0
 
LVL 9

Author Closing Comment

by:Seven price
ID: 37787879
cool thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

I have answered several questions lately that were solved utilizing the power of jQuery's AJAX functions, so I thought I would write an article demonstrating the ease of use. Why should I use jQuery as opposed to regular JavaScript? Now I know…
There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

824 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