This is probably a stupid question, but I don’t know this stuff and need some help. I have a form with 2 text box, and I want to pass the user-entered contents of the 1st text box to a php variable ($size)(without posting the page) on onBlur of 1st textbox. how do i do this???

Recommended Answers

You will need to have an ajax call to your current page on the blur event of your text box.

Jump to Post

Have some patience and dont repeat thread... :)

Jump to Post

All 5 Replies

You will need to have an ajax call to your current page on the blur event of your text box.

This is probably a stupid question, but I don’t know this stuff and need some help. I have a form with 2 text box, and I want to pass the user-entered contents of the 1st text box to a php variable ($size)(without posting the page) on onBlur of 1st textbox. how do i do this???

my code is

<body>
<?php
 function MonthDays($someMonth, $someYear)

      {

      return date("t", strtotime($someYear . "-" . $someMonth . "-01"));

      }
//for example	  


$someMonth=2;	// i want   $someMonth=monthtxt.value
$someYear=2011; // i want $someYear=yeartxt.value
$d=MonthDays($someMonth, $someYear);	
echo $d;  

 
?>

<form name="tt">
month<input type="text" class="contact_input" name="monthtxt"   >
<br>
year<input type="text" class="contact_input" name="yeartxt" >
<br>
Total days<input type="text" class="contact_input" name="yeartxt" id="" value="<?php echo $d ; ?>" >
</form>
</body>

Have some patience and dont repeat thread... :)

Threads merged.

u can even use javascript to solve this stuff.....try it ...i will return after 2 days n give u the code.....till then hope either other solve ur prblm or u have solved it urself.....
PS :-i m at present busy wid my project stuff....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.