我试图根据两个 ahref 标签更改表单操作,一个是按钮,另一个是文本。当它点击按钮时,表单的动作应该是/profile.php?id=,如果点击了文本,动作应该是/profile.php?uid= 我卡在这个问题上。这是我在 html 中的代码:
<a href = "profile.php?/edit/employment-information/" id="edit"><input type="button" name="editemp" id="edit" value="Edit">
<a href="profile.php?/add/employment-information/" id="add">Add Information</a>
<form name="empform" method="post" action="profile.php" autofocus id="form">
<input name="employ" type="text" id="employ" pattern="[A-Za-z ]{3,20}" placeholder="Who is your employer?">
<input name="position" type="text" id="position" pattern="[A-Za-z ]{3,20}" placeholder="What is your job description?">
<input name="empadd" type="text" id="empadd" pattern="[A-Za-z0-9@#$% ,]{5,30}" placeholder="Where is your work address?">
<input name="empcont" type="text" id="empcont" pattern="[0-9]{11}" title="11-digit number" placeholder="Contact number">