Dialoguebox Appear On onmouseover() or Onclick()

Discussion in 'JavaScript' started by Fatima, Feb 21, 2007.

  1. #1
    I am wondering if any help regarding Javascript,CSS and ASP about to this query....
    How can a dialogue box with form element display or visible while using onmouseover or onclick event on a link in a page ..
    In a dialogue box where we are asking for a number, after enter the number the page should redirect to another page with some hide values and tht number 2 either in the form of querystring or in the form of form values ...on the same time....??
    Thanks;
     
    Fatima, Feb 21, 2007 IP
  2. Fatima

    Fatima Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes! I m not Good in Javascript......so i do have problems

    while dealing witth basic even...
    i m using prompt() method ;
    
    <html>
    <head>
    <script type="text/javascript">
    <!--
    function prompter() {
    var reply = prompt("Type A Number ?", "")
    alert(reply);
    }
    //-->
    </script>
    </head>
    <body>
    <%= "<a 
    
    href='edUp_Imga.asp?Img_status=Yes&pro_cat="&pro_cat&"&cat_
    
    typ="&cat_typ&"&pro_nam="&pro_nam&"&id="&AXProductId&"&rid=
    
    "&ReferenceId&"&reply="&reply&"' 
    
    onClick='prompter()'>[&nbsp; Add More &nbsp;]</a>" %> 
    </body>
    </html>
    
    Code (markup):
    I m using simple onClick to call a prompter() function

    (1) basic problem : I need to get input as the number from
    the user "reply" and redirect this value and all other
    parameters as shown in the link tag above as the
    querystring to the next page named as "edUp_Imga.asp"
    i m getting img_status,pro_cat,cat_typ,pro_nam,id,rid...but
    not reply.........???? on the next page edUp_Imga.asp........????
    How can i acheive this while using prompt?

    (2) And If Is there another refined way to do this coz i dont want
    to use a prompt() method for asking input from the user or should i
    move to DOM ?like this......
    document.getElementById( somthing ).style.display='none '
    using a
    <Div id= somthing>
    Type a Number :<br>
    <input type'="text" value="" name="number" >
    </div>
    ....... any help ????
    THanks
     
    Fatima, Feb 21, 2007 IP
  3. -NB-

    -NB- Peon

    Messages:
    153
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What type of dialog box are you talking about? To just display a message, use alert('Hello world'), to prompt for something (Show a message and ask for data), use prompt('valueName', 'Say something to the world!').

    Nick Berlette
     
    -NB-, Feb 21, 2007 IP
  4. Fatima

    Fatima Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes like a Prompt... just use to take input from the user i have the problem when i want to pass tht value to the next page like other values ...as i already discuss earlier
     
    Fatima, Feb 21, 2007 IP
  5. designcode

    designcode Well-Known Member

    Messages:
    738
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    118
    #5
    Hey Fatima pass the asp variable to js function prompter, and use window.location to redirect page with wanted values. Its been so long when I last time worked on ASP, so I can't post the exact solution of your example, however I am posting a generic code, you can modify it a/c to your need.

    
    <html>
    <head>
    <script type="text/javascript">
    <!--
    function prompter(myparam) {
    var reply = prompt("Type A Number ?", "")
    window.location = "edUp_Imga.asp?Img_status=Yes&myparam=" + myparam + "&reply =" + reply ;
    }
    //-->
    </script>
    </head>
    <body>
    <%= "<a 
    
    href='edUp_Imga.asp?Img_status=Yes&pro_cat="&pro_cat&"&cat_
    
    typ="&cat_typ&"&pro_nam="&pro_nam&"&id="&AXProductId&"&rid=
    
    "&ReferenceId&"&reply="&reply&"' 
    
    onClick='prompter('&ReferenceId')'>[&nbsp; Add More &nbsp;]</a>" %> 
    </body>
    </html>
    
    Code (markup):
    I am not exactly sure about concatenation, escaping and variable usage in ASP, so it may have parse error, you will have to tweak a code a bit. Hope this helps.
     
    designcode, Feb 22, 2007 IP