0

I'm developing a mobile web app using javascript and backbone.

I have a text box on the html page as follows :

<input type="text" id="searchquery" name="name" value="Alien"/>

however on the html page it won't allow me to enter any values into the box. Im confused as Ive downloaded many examples with the same html for the box and they all work.

Do I have to initialize it in my .js file or something?

Any help would be greatly appreciated as the app is coming along nicely but this small error is causing a huge disruption.

abraham
  • 46,583
  • 10
  • 100
  • 152
Travis
  • 705
  • 6
  • 30

2 Answers2

0

If you use jQuery you must init code in:

jQuery(document).ready(function(){ $("#searchquery").click(_your_function) });

Another possibility is init on bottom page but advised not to put javascript code in content of page (read about XSS).

<body>
...
<script>init();</script><!-- By default it is javascript -->
</body>

Last possibility is create the code to check the status of the page: See: Check document state

Community
  • 1
  • 1
Eraden
  • 2,818
  • 1
  • 19
  • 17
0

You need to make sure something isn't laying over your input. There's nothing wrong with your html. Unless you've got some script disabling it, the most likely cause, I think, would be a div or something without a background and therefor transparent covering it up.

JayC
  • 7,053
  • 2
  • 25
  • 41