xwishmasterx Posted February 13, 2014 Share Posted February 13, 2014 Hello I have a very wierd problem. Below code is a simple login form: <form action="verify.php" method="post"> User Name:<br> <input type="text" class="login" name="" ><br><br> Password:<br> <input type="password" class="login" name="password"><br><br> <div align="center"><input type="submit" name="submit" value="Login"></div> </form> The above code works fine, but if I add any value to the name attribute in the first input field, the style doesn't work. (except if I enter "password") Seems the css for background-image isn't added when entering anyname. Anyone have an idea why this happens? Link to comment https://forums.phpfreaks.com/topic/286170-input-style-not-working-when-adding-name/ Share on other sites More sharing options...
a100websolutions Posted February 13, 2014 Share Posted February 13, 2014 Please use the ending tag " / " for your input elements. Maybe that will work Link to comment https://forums.phpfreaks.com/topic/286170-input-style-not-working-when-adding-name/#findComment-1468739 Share on other sites More sharing options...
xwishmasterx Posted February 13, 2014 Author Share Posted February 13, 2014 Already tried that..thanks. It seems it's the background property that isn't working as I can style height, width etc.. What puzzles me is that adding something to the name attribute kills the background style. Seems adding any value to the input and css works fine again. Link to comment https://forums.phpfreaks.com/topic/286170-input-style-not-working-when-adding-name/#findComment-1468744 Share on other sites More sharing options...
Ch0cu3r Posted February 13, 2014 Share Posted February 13, 2014 What is the css you are using to style your inputs? Styling a field based on a name works fine http://jsfiddle.net/8LrhW/1/ Link to comment https://forums.phpfreaks.com/topic/286170-input-style-not-working-when-adding-name/#findComment-1468745 Share on other sites More sharing options...
xwishmasterx Posted February 13, 2014 Author Share Posted February 13, 2014 Tried that also. The really wierd thing is I'm using the style on other forms/inputs without issues and only have one stylesheet. I did a work around for now (adding value=" " - then remving the whitespace on sending) will mark as solved anyways. thanks for the ideas Link to comment https://forums.phpfreaks.com/topic/286170-input-style-not-working-when-adding-name/#findComment-1468752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.