Jump to content

QUESTION regarding getting values on forms

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
hardinera

hardinera

    Learning Programmer

  • Members
  • PipPipPip
  • 42 posts
QUESTION : is it possible to get data on a form without clicking a button? like auto get the value and auto checking the value inside it? i don't know the proper word for this.. like the check box.. if checked and unchecked -.-

i just want to disable some fields based on he selected value... i'm using menu box by the way.

thanks for anyone who can answer me...:love:

#2
zeroradius

zeroradius

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,406 posts
yes it is. I have not done it myself but i can tell you that you will use javascript (posibly ajax which is a technique for javascript but id say you would probably be fine with regular javascript) you will want to use the onblur event, it trigers when you lose focus on a control (click out of it). If you have it run a function that checks the values of the filed that just lost focus (blured) and than hides or shows various controls based on the results using getElementById. Sorry that I can't be more help but i just started javascript.
Posted Image

#3
Bioshox

Bioshox

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts
You mean get the data from a database and automaticly insert it into the textbox/area?

<form action='updateabout.php' method='post'>
<h3>Body:</h3> 
<textarea name="content" rows="15" cols="50" ><?php echo stripslashes($row['body']); ?></textarea>
<br>
<input type='submit' name='submit' value='Edit Page' />
</p>

Make sure you already have the query running before this HTML :) but Basicly all you need to do is add this imbetween the textarea tags!

<?php echo stripslashes($row['body']); ?>


#4
hardinera

hardinera

    Learning Programmer

  • Members
  • PipPipPip
  • 42 posts
Attached File  &#119;&#101;&#101;&#101;&#101;&#101;&#101;&#101;&#46;.jpg   45.53K   15 downloads
the form is kinda like this... and based on the selected date... the items inside the menu box will be disabled... is this possible or not?

based on the dates selected and room... it will count how many reservations are.

like in visual basic for example... can auto compute even without clicking any button.. kinda like that -.-

Edited by hardinera, 10 March 2010 - 11:49 PM.