Author Topic: javascript to mySQL  (Read 377 times)

0 Members and 1 Guest are viewing this topic.

Offline knivesTopic starter

  • Irregular
  • Posts: 1
    • View Profile
javascript to mySQL
« on: August 15, 2008, 09:09:19 PM »
Hi guys, is there anybody who knows how to connect javascript form to mySQL in php in order to INSERT data into the database itself? I do have the form already which I made, then it is well functioning already. I put restriction to the fields from my codes and it does trap errors or invalid entry! But since javascript has the function get.Elementbyid, i can no longer connect it to mySQL because i have to  change the "name" into "id"

 ex:(<input name="username" type="text">)  to (<input id="username" type="text">).

Can anybody help me with this?

Offline Barand

  • Sen . (ile || sei)
  • Staff Alumni
  • 'Mind Boggling!'
  • *
  • Posts: 15,132
  • Gender: Male
  • php 4.3/5.1 MySql 5.0.1
    • View Profile
Re: javascript to mySQL
« Reply #1 on: August 15, 2008, 09:40:43 PM »
you can have a name and an id

<input name="username"  id="username" type="text">
|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts
|baaSelect| generate js and php code for dynamic linked dropdowns

Offline fenway

  • MySQL Si-Fu / PHP Resident Alien
  • Global Moderator
  • 'Mind Boggling!'
  • *
  • Posts: 15,444
  • Gender: Male
    • View Profile
Re: javascript to mySQL
« Reply #2 on: August 17, 2008, 04:02:35 PM »
But since javascript has the function get.Elementbyid, i can no longer connect it to mySQL because i have to  change the "name" into "id"
Not it IE... which is a bug I had to fixes on someone else's website who never bothered to check the site in Firefox.  Yeesh.
:anim_rules: Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.