SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast Daniel,D,D's Avatar
    Join Date
    Apr 2009
    Location
    Sandy utah USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Get Php From Javascript?

    Dose any one know if I can turn javascrit into php???

    specifically this

    disabled="disabled" onchange="javascript:setTimeout('__doPostBack(\'name\',\'\')', 0)" name="name">

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Certain things you do in javascript can also be done with php(like, math for example), but you need to realize php is a serverside language, and javascript is a clientside language. The first few pages should help clarify the difference for you http://www.sitepoint.com/article/adv...design-primer/

    Maybe if you explain what, and why, you think you need/want to do with php, we can help.

  3. #3
    SitePoint Enthusiast Daniel,D,D's Avatar
    Join Date
    Apr 2009
    Location
    Sandy utah USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm making a "look up" in php,
    and I want it to update when I select an option,
    and not have to use a submit button.
    And yes I know php is server side.

  4. #4
    SitePoint Enthusiast Daniel,D,D's Avatar
    Join Date
    Apr 2009
    Location
    Sandy utah USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also I don't want the javascript in the php file just a way to do the same thing.

    but if you think javascript is better for what I'm making, feel free to tell me.

  5. #5
    SitePoint Zealot Cute Tink's Avatar
    Join Date
    Apr 2009
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems to me what you are looking to do is something with Ajax. You can use Javascript's Ajax to send a request to a php page and receive a response without loading a separate page. I'd suggest googling Ajax tutorial or something similar or moving to the Javascript section for further help.

  6. #6
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're asking for a way to submit a form without the user having to press a button? This is something only a clientside language can do, because a serverside language has already finished executing by the time the web page has loaded.

  7. #7
    SitePoint Enthusiast Daniel,D,D's Avatar
    Join Date
    Apr 2009
    Location
    Sandy utah USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok thanks.


Bookmarks

Posting Permissions

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