如何在具有多个争论的OnChange事件中调用javascript或选择下拉值

时间:2016-02-28 14:02:18

标签: javascript php jquery html onchange

我对此非常陌生,我认为我不应该混淆客户端和服务器端之类的所有内容......但我想不出任何其他选择。

我想要的是接受下拉选择的值并使用<div class="control-group" onChange="saveTasks('<?php echo $row["taskid"]; ?>', **this.selectedIndex** ,'vendorname')"> 函数将其写回数据库。

this.selectedIndex

问题是我也有PHP函数和this.selectedIndex作为HTML函数。

我也试过JS而不是<div class="control-group" onChange= "saveTasks('<?php echo $row["taskid"]; ?>', **myFunction()** ,'vendorname')"> (下面提到):

@Component
public class CustomAuthenticationProviderImpl implements UnalAuthenticationProvider {

    @Autowired
    private CustomUserDetailService customUserDetailService;

    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
        String username = authentication.getName();
        String password = (String) authentication.getCredentials();

        UserDetails user = null;

        try{
            user = (UserDetails) customUserDetailService.loadUserByUsername(username);
        }
        catch(UsernameNotFoundException ex){
            System.out.println("User name not found");
            throw ex;
        }

        if (user == null) {
            throw new BadCredentialsException("Username not found.");
        }

        if (!password.equals(user.getPassword())) {
            throw new BadCredentialsException("Wrong password.");
        }

        Collection<? extends GrantedAuthority> authorities = user.getAuthorities();

        return new UsernamePasswordAuthenticationToken(user, password, authorities);
    }


    public boolean supports(Class<?> arg0) {
        return true;
    }

}

但不知道什么是正确的语法。

0 个答案:

没有答案