Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't receive value from input field
    primarykey
    data
    text
    <p>i have problem on sending textbox value from one html page to another html page. In first page i am sending first name and last name values.and i want to catch this value in textbox on the second page( i.e home.html).but some erroe occurs.</p> <p>error is :Uncaught TypeError: Cannot set property 'value' of null </p> <p>how to solve? please tell me. i know this stupid question.but please tell me guys.i don't know javascript. </p> <p>this is my html code:</p> <pre><code> &lt;!DOCTYPE html"&gt; &lt;html&gt; &lt;head&gt; &lt;script src="ttt.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form method="get" action="home.html" name="ff"&gt; Firstname: &lt;input id="f" type="text" name="firstname1"&gt; Lastname: &lt;input type="text" name="lastname"&gt; &lt;input type="submit"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>this is my home.html code:</p> <pre><code> &lt;!DOCTYPE html"&gt; &lt;html&gt; &lt;head&gt; &lt;script src="ttt.js"&gt;&lt;/script&gt; &lt;script Language="JavaScript"&gt; var tttt=val(); document.getElementById('text').value=tttt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form name="ff"&gt; &lt;input id="text" class="text" type="text" name="MyValue" value="helloS"/&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>this is my javascript code(ttt.js)</p> <pre><code>function val(){ var link=location.href; var str=link.split('?'); var str1=str[1].split('&amp;'); var str11=str1[0].split('='); var str12=str1[1].split('='); var temp=str11[1]+" "+str12[1]; return(temp); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload