我的点击页面的Html代码是:
<input type="submit" id="publishButton-ns" class="ubtn ubtn-block"
name="publish" tabindex="10" value="Publish Post">
Run Code Online (Sandbox Code Playgroud)
我试过这个代码点击:
webBrowser1.Document.GetElementById("publishButton-ns").InvokeMember("click");
Run Code Online (Sandbox Code Playgroud)
但是没找到按钮.
我提交连接表单时出现此错误(我使用FOSUserBundle最新版本):
No encoder has been configured for account "MyApp\UtilisateurBundle\Entity\Utilisateur
Run Code Online (Sandbox Code Playgroud)
这是我的实体:
<?php
namespace MyApp\UtilisateurBundle\Entity;
use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Utilisateur extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\generatedValue(strategy="AUTO")
*/
protected $id;
public function __construct()
{
parent::__construct();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的app/config/security.yml:
imports:
- { resource: "@MyAppFilmothequeBundle/Resources/config/security.yml" }
Run Code Online (Sandbox Code Playgroud)
这是我的src/MyApp/FilmothequeBundle/Ressources/config/security.yml:
security:
providers:
fos_userbundle:
id: fos_user.user_manager
firewalls:
main:
pattern: .* …Run Code Online (Sandbox Code Playgroud) 我不确定我在这里做错了什么.我想使用回车键以及单击按钮.
<form action="" method="get" class="priceOptionForm" name="priceOptionForm">
<input name="paypal_email" type="text" value="whatever" id="email"></label>
<a href="javascript:void(0);" class="bluebtn" id="profile_price" style="width:60px;margin-top:5px;">Save all</a>
</form>
Run Code Online (Sandbox Code Playgroud) 有没有办法让fancybox(http://fancy.klade.lv/)或任何其他灯箱提交FORM(带图像按钮)?
HTML看起来像这样:
<form action="/ACTION/FastFindObj" method="post">
<input name="fastfind" class="fastfind" value="3463" type="text">
<input name="weiter" type="submit">
</form>
Run Code Online (Sandbox Code Playgroud)
这些不会做:
$("form").fancybox();
$("input").fancybox();
$("input[name='weiter']").fancybox();
Run Code Online (Sandbox Code Playgroud)
有人发现我的错误或有解决方法或替代脚本?提前致谢
有没有办法从jQuery提交iframed表单?我所拥有的是以下内容:
$('button#bookingButton').click(function(){
$('<iframe id="externalSite" class="externalSite" src="/form/page" />').dialog({
title:'Form',
autoOpen: true,
width: 800,
height: 600,
modal: false,
resizable: false,
buttons:{
'Close':function(){$(this).dialog("close");},
'Add Booking':function(){$('form#bookingForm').submit();}
}
}).width(800 - 25);
});
Run Code Online (Sandbox Code Playgroud)
这将创建一个jQuery ui对话框,其中包含一个iframe.这工作正常,常规提交按钮工作正常,但jQuery按钮不提交表单.
我有我的Ajax工作,内置Rails javascript,提交按钮.但是,当我更改下拉框的值并取消按钮时,我希望它提交.在我的研究中,我发现了什么看起来是正确的解决方案,但我没有得到服务器的请求.这是我的下拉表单代码,请注意它在我添加之前仍然有提交按钮:onchange:
<% form_tag('switch_car', :method => :put, :remote => true) do %>
<div class="field">
<label>Car Name:</label>
<%= select_tag(:id, options_from_collection_for_select(active_cars, "id", "name"),
:onchange => ("$('switch_car').submit()"))%><%= submit_tag "Switch Car" %>
</div>
<% end %>
Run Code Online (Sandbox Code Playgroud)
这是生成的HTML:
<form accept-charset="UTF-8" action="switch_car" data-remote="true" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓" />
<input name="_method" type="hidden" value="put" />
<input name="authenticity_token" type="hidden" value="PEbdqAoiik37lcoP4+v+dakpYxdpMkSm7Ub8eZpdF9I=" />
</div>
<div class="field">
<label>Car Name:</label>
<select id="id" name="id" onchange="$('switch_car').submit()">
<option value="9">Truck</option>
<option value="10">Car</option>
</select>
<input name="commit" type="submit" value="Switch Car" />
</div>
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助.
我希望我的表单提交按钮被禁用/启用,具体取决于表单是否完全填满.
填充输入后,禁用按钮将更改为启用.这很好用.但我希望它在输入被清除时禁用按钮.
这是我的脚本:
<script type="text/javascript" language="javascript">
function checkform()
{
var f = document.forms["theform"].elements;
var cansubmit = true;
for (var i = 0; i < f.length; i++) {
if (f[i].value.length == 0) cansubmit = false;
}
if (cansubmit) {
document.getElementById('submitbutton').disabled = false;
}
}
</script>
<form name="theform">
<input type="text" onKeyup="checkform()" />
<input type="text" onKeyup="checkform()" />
<input id="submitbutton" type="submit" disabled="disabled" value="Submit" />
</form>
Run Code Online (Sandbox Code Playgroud) 使用 AspNet Blazor 及其 EditForm:我正在创建一个简单的表单,它应该包含一个更新和一个删除按钮。我似乎没有找到任何关于如何将参数传递给提交的示例。
我试图在删除按钮中放置一个@onclick 指向DeleteObject,但后来我没有得到验证(在这种情况下我实际上不需要验证,但无论如何我都想这样做),而且在之后也调用了 SaveObject删除...
<EditForm Model="@selectedCar" OnValidSubmit="@SaveObject">
<DataAnnotationsValidator />
<ValidationSummary />
....My <InputText>'s for all values I have in my object
<button type="submit" class="btn btn-primary" value="Save">Spara</button>
<button type="submit" class="btn btn-primary" value="Delete">Delete</button>
</EditForm>
@code {
[Parameter]
public string Id { get; set; }
CarModel selectedCar;
protected override async Task OnInitializedAsync()
{
selectedCar = await _CarService.GetCar(int.Parse(Id));
}
protected async Task SaveObject()
{
selectedCar.Id = await _CarService.SaveCar(selectedCar);
}
protected async Task DeleteObject(int Id)
{
selectedCar.Id = await _CarService.DeleteCar(selectedCar);
} …Run Code Online (Sandbox Code Playgroud)