1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Submit form to hash

Discussion in 'JavaScript' started by ker, Aug 6, 2011.

  1. #1
    Hello!
    I need to submit my form to hash (index.php#a=b&c=d instead of (index.php?a=b&c=d).
    Is there a way to get url before submitting 
    Thanks!
     
    ker, Aug 6, 2011 IP
  2. jaimegm

    jaimegm Member

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Could you explain more your question?
     
    jaimegm, Aug 6, 2011 IP
  3. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #3
    if you have jquery, you can add this code...
    
    <script type="text/javascript">
    
    $('form').submit(function() {
    var form_data = ($(this).serialize()); 
    window.location = "#" + form_data;
    return false; 
    });
    
     
    </script> 
    
    HTML:
     
     
    JohnnySchultz, Aug 8, 2011 IP
    ker likes this.
  4. ker

    ker Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Thank you...
     
    ker, Aug 8, 2011 IP