need php+html help

Discussion in 'HTML & Website Design' started by ahsan11223, Apr 29, 2013.

  1. #1
    hello guys,
    this is the php view of this page.
    andalustaibah.com/mofa/index.php
    i hav point out the area which is not working.
    [​IMG]



    if selecting name entered "khalid" in search field and searched.. then it come View button.

    i like to open this view button in New window. can any one help please..
     
    ahsan11223, Apr 29, 2013 IP
  2. ntmedia

    ntmedia Active Member

    Messages:
    118
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    90
    #2
    target="_blank" is used for <a> tag not for input.

    If you want to open url using input (why would you even want to do that?) use javascript on click function

    add this to your code:
    onClick="window.open(url,'_blank');"
    Code (markup):
     
    ntmedia, Apr 29, 2013 IP
  3. ahsan11223

    ahsan11223 Active Member

    Messages:
    725
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #3
    you mean to say i should replace this code
    target='_blank' />

    with
    onClick="window.open(url,'_blank');"

    if anything missing do tell me .. thanks for your help
     
    ahsan11223, Apr 29, 2013 IP
  4. ntmedia

    ntmedia Active Member

    Messages:
    118
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    90
    #4
    yeah. I haven't tested it out because I haven't seen anyone use it quite like that.

    Here's a working example: http://jsfiddle.net/RV9dJ/
     
    ntmedia, Apr 29, 2013 IP
  5. ahsan11223

    ahsan11223 Active Member

    Messages:
    725
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #5
    my friend you are right . but the thing is that

                        echo "
        <form method='post' action='js/$rfile'>
          Passport ID: <b>$rid</b><br/>
          Voucher ID: <b>$rvid</b><br/>
          Name: <b>$rname</b><br/>
          Upload Date: <b>$rdate</b><br/>
          Arrival Date: <b>$radate</b><br/>
          Departure Date: <b>$rddate</b><br/>
          Check In Makkah (1): <b>$rcimak1</b><br/>
          Check Out Makkah (1): <b>$rcomak1</b><br/>
          Check In Madinah (1): <b>$rcimad1</b><br/>
          Check Out Madinah (1): <b>$rcomad1</b><br/>
          Check In Makkah (2): <b>$rcimak2</b><br/>
          Check Out Makkah (2): <b>$rcomak2</b><br/>
          Check In Madinah (2): <b>$rcimad2</b><br/>
          Check Out Madinah (2): <b>$rcomad2</b><br/>
              <input name='submit' type='submit' class='formbutton' id='submit' value='VIEW'  onClick="window.open('url','_blank');"></input>
          <br/>
        <br/>
        <br/>
        </form>
    Code (markup):
    this gave error:
    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/cricketz/public_html/andalustaibah.com/mofa/index.php on line 218

    If you fully understood my question, then also know that the new window which wil be opened it should be that pdf file which is opening in same window, i like to open that file in new window.

    come on do once more and understand first what i need to be done.
    go to this page.

    andalustaibah.com/mofa/index.php

    select name and write Khalid press search button. and there you see VIEW button. click VIEW button loads
    http://andalustaibah.com/mofa/js/fb1eecc202dbf936476c2b8f6e16b466.pdf
    in same window.
    it is a problem here and i want that
    clicking VIEW should open a new window in which that document of pdf opened..

    I hope you understand this time.
     
    ahsan11223, Apr 30, 2013 IP
  6. ansaripk

    ansaripk Greenhorn

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #6
    @ntmedia is right. you should remove target="_blank" code from input tag. He also told an alternate method that works. cheers!
     
    ansaripk, Apr 30, 2013 IP
  7. HussainMHB

    HussainMHB Member

    Messages:
    62
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #7
    He's quite correct.
    Target attribute is only for anchor tag.<a>.
    So you should have removed that from input tag.
    There you go...
     
    HussainMHB, May 1, 2013 IP
  8. ahsan11223

    ahsan11223 Active Member

    Messages:
    725
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #8
    ansari & hussain please read what i found when i did as ntmedia instructed. my work is still in complete. i like that view button is opened in a new window. any other successful alternative.
     
    ahsan11223, May 1, 2013 IP