I have this link that creates several divs in which the form is loaded via load (). This form is in a separate php file. Now I want to use the ID value of my link to set the value of the input field, but how?
I know that I need live () for this, but setting the value should be automatic, not after the event.
This is the situation as below
main.php
[..]
<a href="form.php" rel="box" id="inputvalue">
form.php
<form>
[..]
<input type="text" id="el">
Now I want to set 'inputValue' (when loading form.php) as the new value of $ ("# el"), but how?
My javascript file is in main.php and the way to load form.php is as follows
$("a").click(function(){
if(this.rel == "box"){
[..]
$("#container").load("form.php");
When the form is displayed, I want to change the input value
source
share