0
我有一個表單頁面,當我提交此表的所有輸入,不同的是這一次成功發佈:<input>元素不發佈數據?
<input id="TC" class="form-control" name="kullanici_id" type="text" onchange="edit()"
<?php if($this->data['kullanici_id']){echo 'readonly';} ?>
value="<?php echo $this->data['kullanici_id']?>">
但是,爲什麼?
- 這是我的一個.phtml文件:
<html>
<head>
</head>
<body>
<form enctype="multipart/form-data" action="/admin/kaydet" method="post" onSubmit="javascript: beforeSubmit();">
<?php if(strlen($this->data['id'])):?>
<input type="hidden" name="id" value="<?php echo $this->data['id']?>">
<?php endif;?>
<font color="green"><h3>DÜZENLE</h3></font>
<img src="/foto/<?php echo $this->data['fotograf']?>" height="110" width="110" align="left" />
<table class="table">
<tr>
<td>T.C. Kimlik No.:</td>
<td><input id="TC" class="form-control" name="kullanici_id" type="text" onchange="edit()" <?php if($this->data['kullanici_id']){echo 'readonly';} ?> value="<?php echo $this->data['kullanici_id']?>"></td>
</tr>
<?php if(!strlen($this->data['id'])):?>
<tr>
<td>Parola:</td>
<td><input id="password2" class="form-control" type="password" name="parola" value="<?php echo $this->data['parola']?>"></td>
</tr>
<tr>
<td>Parola Tekrar:</td>
<td><input onchange="passwordCheck(this.value)" class="form-control" type="password" name="parola" value="<?php echo $this->data['parola']?>"></td>
</tr>
<?php endif; ?>
</table>
<td><button type="submit" class="btn btn-success btn-sm glyphicon glyphicon-floppy-disk">KAYDET</button> </td>
</form>
</body>
</html>
如果我有一個id;頁面看起來像編輯成員頁面,如果我沒有;頁面將添加一個新成員。在id =「TC」輸入中,如果我編輯了一個成員,這個輸入不應該改變,所以我添加一個readonly來解決這個問題。但是當我提交時,輸入不會發布。 對不起我的英文不好:D
似乎像場被設置爲'readonly',因此任何更改將被丟棄,並張貼到服務器。您可能想向我們展示實際文章的外觀。 –
請發佈完整的源代碼。 – Noman
@IsaacKleinman,因爲在給定的代碼中只有'readonly''''' disabled''。所以它肯定會被處理 –