Jump to content


Photo

how to get values from textfield without submiting or refreshing??


  • Please log in to reply
4 replies to this topic

#1 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 05 September 2006 - 05:15 AM

Hai guys i am in trouble i need a help

i am having a listbox and one textfield. in that if i change a listbox i got a value in textfield and how to get the values for my query.



#2 mitzleah

mitzleah
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts
  • LocationManila, Philippines

Posted 05 September 2006 - 05:31 AM

Hey,

put this code in select tag

onChange="document.nameOfForm.submit();"

like this:
<select name="" onChange="document.nameOfForm.submit();">
  <option></option>
</select>

Hope this one will help!

#3 rajmohan

rajmohan
  • Members
  • PipPipPip
  • Advanced Member
  • 169 posts

Posted 05 September 2006 - 06:00 AM

no i want to retrive

get value from textfield value to php

this value is kept in javascript


#4 mitzleah

mitzleah
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts
  • LocationManila, Philippines

Posted 05 September 2006 - 06:17 AM

if the form method is post
use $_POST['textfieldname']

if the form method is get
use $_GET['textfieldname']

The title (how to get values from textfield without submiting or refreshing??) confused me. Hope I'm getting you!

#5 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 05 September 2006 - 06:37 AM

To do this without refreshing you will need to use an Ajax technique, if you're wanting to do this purely with PHP, you're pretty much out of luck I'm affraid...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users