Jump to content


Photo

DOM


  • Please log in to reply
4 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 28 April 2006 - 02:35 AM

How do I access strictly to a form field. I am trying to do something with javascript and php, I have a function created in javascript, that I am trying to secure, then I am going to use it with php to validate, what do I do to access a form field. Right now I have a function with onsubmit() and I called it, but I am not accessing the form fields right I tried multiple ways, because I also need to use this to create some classes in php, I tried
for instance my firstname field
I tried test form is the name of my form by they way
document.testform.firstname
I tried
document.testform.['firstname']
document.testform.["firstname"]
I even tried
window.document.testform.firstname
window.document.testform.['firstname']
and
window.document.testform.["firstname"]
nothing here gives me access to that form field. How do I correctly gain access to this,

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 28 April 2006 - 03:15 AM

can anyone help with this, it's the only thing holding me back< I am still trying to figure out something but everything I try is not working, I can't get the function to access the form field no matter what I put in, I know my own submit works, I have tested that, it has something to do with me accessing the fields, my function structure is good, I triple checked it to make sure I set up everything the only thing I can think of is I am not accessing the form field right.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 28 April 2006 - 04:07 AM

bump

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 28 April 2006 - 04:22 AM

okay dude seriously, this is like how many times I and other people have told you that you are asking javascript questions in a php forum. please go to javascript forum to get javascript questions answered. I would be more than happy to help you if i knew javascript. but i don't. that's why i'm here. and so is everybody else.

but nonetheless, i googled "javascript get form value" (google is your friend too) and i think what you are looking for is something along this line:

variablename=nameofform.nameoffield.value;


example:

<form name="blah" method="post">
enter fruit<input name="fruit">
</form>

and then

<script = 'javascript'>
fruitchoice = blah.fruit.value;
document.write(fruitchoice);
</script>
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 28 April 2006 - 12:41 PM

thanks

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users