Solved

HTML form button and input not formatting correctly

Posted on 2012-03-26
3
251 Views
Last Modified: 2012-03-26
I am having some difficulty getting an input button to work.  

In the code below, when I include the button inside the form id="searchform", it aligns correctly as I am looking for, but it does not trigger the onclick action when pressed.

When I include the button outside the form id="searchform", it aligns incorrectly, but it does trigger the onclick action when pressed.

I figure that I need to either make the form react to the button click when the button is inside the form element, or figure out a better way to align the button when I include it outside the form element.

Here is the code:

    <div id="searchbox" align="right">
      <form id="searchform">      	
        <button class="i_magnifying_glass icon small green" value="Go" 
                    onclick="if($('#add_nox').val()!='')loadProperty($('#add_nox').val())" >
       </button>
        <input  id="add_selectx" 
                    style="width:100px; text-align:left" 
                    type="text" 
                    placeholder="Search" 
                    onblur="rollnum=jQuery('#add_nox').val();" />
        <input  id="add_nox" 
                    type="text" 
                    value="" 
                    style="display:none;"/>                       
       </form>
    </div>

Open in new window

Would appreciate any suggestions.  Thank you.
0
Comment
Question by:DanielAttard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
William Fulks earned 500 total points
ID: 37768501
Could be because you haven't specified a type for the button. Check this out:

http://www.w3schools.com/tags/tag_button.asp
0
 

Author Closing Comment

by:DanielAttard
ID: 37768534
Great work phungy!  Your good deed is done for the day.  Thanks for helping me out.
0
 
LVL 14

Expert Comment

by:William Fulks
ID: 37768692
Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Read text on Table 7 30
HTML editor custom button 3 59
Check input text, Number 7 36
Keyup listener getting fired on initial page load 1 16
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question