-1

I want to submit the form with easyui and test if it works. When I try, no data is being returned. Inclduded below is my html. There is only one line of code in the php file, loginvalidate.php:

echo hello world 

Why is there not data returned? The alert just does not appear.

<div class="easyui-panel" title="LOGIN" style="width:400px;padding:30px 70px 20px 70px">
<form  method="post" id="loginform" name="loginform">

    <div style="margin-bottom:20px">
    <input type="submit" id="submit" name="submit"/>
        <input type="text" class="easyui-textbox" value="<?php if(isset($_COOKIE['username'])) echo $_COOKIE['username']; ?>" name="username" style="width:100%;height:30px;padding:12px" data-options="iconCls:'icon-man',iconWidth:38,prompt:'username'" />
    </div>
    <div style="margin-bottom:20px">
        <input type="text" class="easyui-textbox" value="<?php if(isset($_COOKIE['password'])) echo $_COOKIE['password']; ?>" name="password" style="width:100%;height:30px;padding:12px" data-options="iconCls:'icon-lock',iconWidth:38,prompt:'password'" />
    </div>
    <div style="margin-bottom:20px">
        <input type="checkbox" name="remMe" <?php if(isset($_COOKIE['username'])){echo "checked='checked'"; } ?>>
        <span>Rember Me</span>
    </div>

    </form>  
    <div>
        <a href="javascript:void(0)" name="atag" id="atag" class="easyui-linkbutton" onclick="$('#loginform').submit();" style="padding:5px 0;width:100%" data-options="iconCls:'icon-ok',iconAlign:'left'">
            <span font-size=10px>login</span>
        </a>

    </div>
</div>
<script type="text/javascript">
    $(function(){
        $('#loginform').form(
        {
            url:'loginvalidate.php',
            success:function(data){
                if(data)//check if data returned
                {
                alert('yes');
                }}
            }
        )
        })
</script>
Carrie Kendall
  • 11,124
  • 5
  • 61
  • 81
生鱼片
  • 1
  • 1
  • it works when i use to submit the form with action="loginvalidate.php" in form tag. Can anybody tell me what is wrong? Thank a lot. – 生鱼片 May 05 '15 at 13:12

1 Answers1

0

ok ,i've solved the problem after repeated efforts. The solution is to alter the inner properties id and name's value not submit. That will work. do not know why.

生鱼片
  • 1
  • 1