Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Form / Link questions.

    Hey. I actually have a couple questions here dealing with an HTML/PHP/javascript page that inserts into a database using an HTML form.

    My first question is: instead of an <INPUT TYPE='submit'> button, is it possible to use a link to submit a form?

    Secondly, I have a popup window that inputs the data into the database using this link:

    Code:
    <A HREF='ViewAccounts.php' onClick='window.open(\"InsertAccount.php\", \"Insert\", 
    \"title=Insert, toolbar=no, directories=no, resize=no, menubar=no, 
    location=no, scrollbars=no, width=900, height=200, maximize=null, 
    top=2, left=50\");'>
    Is it possible to refresh ViewAccounts.php after submitting the form in the popup?


    Thank you,
    -Tim

  • #2
    Banned
    Join Date
    May 2005
    Location
    Midwest, U.S.
    Posts
    118
    Thanks
    1
    Thanked 26 Times in 23 Posts
    Change the style of the submit button to resemble an anchor link:

    http://codingforums.com/showpost.php...10&postcount=9


    You can execute:

    Code:
    window.opener.location.reload(true);
    from the pop-up. The true will "force" a reload from the server, instead of the cached document.

    You probably should be using AJAX though, both to update the database, and to then display the updated information.
    Last edited by Cranford; 08-27-2008 at 07:03 PM.

  • #3
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    The submit botton is working well but I still would like my hover effects. I tried this and it did not work:

    Code:
    <INPUT TYPE='submit' VALUE='Submit' CLASS='submitBtn' onMouseOver='this.className=submitHvr'
    onMouseOut='this.className=submitBtn'>
    Also, where do I put the 'window.opener.location.reload(true);'? I put it under onClick in the submit button but it did not seem to work.

  • #4
    Banned
    Join Date
    May 2005
    Location
    Midwest, U.S.
    Posts
    118
    Thanks
    1
    Thanked 26 Times in 23 Posts
    Did you even think to write "thank you"?

    I'm finished. Someone else can choose to offer help.

  • #5
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    ...? you sound like my girlfriend. I was just trying to clarify your responce before I actually resolved my problem. I would have thanked you if I knew where you wanted me to just 'execute window.opener.location.reload(true);'

    chill out man.

  • #6
    Banned
    Join Date
    May 2005
    Location
    Midwest, U.S.
    Posts
    118
    Thanks
    1
    Thanked 26 Times in 23 Posts
    You "would have thanked" me? Hmm. I'll bet you say that a lot to your imaginary girlfriend.

    And I'm to, "chill out." I wonder how many more times your boss, and others, will tolerate you saying that to them.

    "I would have been on time this morning, but... chill out."
    "I would have remembered your birthday, but... chill out."
    "I would have paid you on time, but... chill out."
    "I would have finished the job on time, but... chill out."

    You have extraordinary inter-personal skills. Certainly, you are at this very moment, being considered for a senior management position.

    Let me quickly step aside, so that I'm not trampled by the rush of those who will now come to your assistance.

  • #7
    New Coder
    Join Date
    Aug 2008
    Posts
    60
    Thanks
    6
    Thanked 6 Times in 6 Posts
    You really need to chill Cranford it really isn't that big a deal...

  • #8
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Seriously?

    This kind of stupid to get into on a coding forum, but if you want a "thanks" for your work everytime you do something -- you're in the wrong business.

    Anyway, You didn't really resolve my problem so why would I thank you? I asked if I could use a link as a submit button, not if I could change the style of my submit button -- I know css.

    I'm sorry I came here for help I guess.



    THANKS


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •