Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.

Two Text Fields in a Form

  • 09-04-2015 11:23PM
    #1
    Posts: 0 ✭✭✭


    Ok I thought this was the best place to post this.

    I have a form.....with a hidden text field and a text field for posting messages.

    The Hidden field is used for Headlines which I want to come through identifying where it came from and whom if the person forgets to put that in the message.

    The thing is I do not want a comma separating the two when it comes through.

    Example:

    HEADLINE , This is the message

    I don't know even the search term to trawl through google....is it possible to remove this comma or even replace it with a dash "-" instead?

    thanks


Comments

  • Registered Users, Registered Users 2 Posts: 419 ✭✭Mort5000


    Which language?


  • Registered Users, Registered Users 2 Posts: 5,751 ✭✭✭veryangryman


    if its java something like...

    String beforeString = "Stuff,moreStuff";
    String afterString = beforeString.replace(",", " ")

    This replaces the comma with a space, effectively removing the comma. Put the dash where the space is to do the desired if thats what you prefer.


  • Registered Users, Registered Users 2 Posts: 12,023 ✭✭✭✭Giblet


    The two inputs have the same name or id, this will cause them to concat together with a ",".
    Give the inputs unique names.


  • Posts: 0 ✭✭✭ [Deleted User]


    ah ok....that explains it.....I can't give them the same name as they are for a Push Notification...

    I will have to live with it I suppose.....thanks lads.


  • Registered Users, Registered Users 2 Posts: 12,023 ✭✭✭✭Giblet


    I mean, two inputs with the same name will cause the issue, the solution is to give them unique names, can you show a excerpt of the HTML?


  • Advertisement
Advertisement