Sign in to follow this  
SwekAap

[help] Sending data from <a> tag to server?

Recommended Posts

Hello, i'm trying to get the character id from an <a> tag and send it to the server so when i click the button it will send that id to the server. Currently i got this in the login.html

<b v-for="character in characters">
    <a class="link-button link-button_margin1 link-button_theme-orange transition-02 hover" v-bind:char_id="character.id" @click="login" v-if="characters">{{ character.name }}</a>
</b>

And the "login" function to send it to the server is here

login: function () {
    mp.trigger("cMisc-CallServerEvent", "sLogin-TryLoginWithoutCode", this.char_id);
}

This.char_id does not work however and will result into my server crashing. I want to send the "character.id" to the server.

 

Thanks in advance.

Share this post


Link to post
Share on other sites

I've fixed it myself.. 

Solution:

<b v-for="character in characters">
    <a class="link-button link-button_margin1 link-button_theme-orange transition-02 hover" @click="login(character.id)" v-if="characters">{{ character.name }}</a>
</b>
login: function (char_select) {
    mp.trigger("cMisc-CallServerEvent", "sLogin-TryLoginWithoutCode", char_select);
}

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.