Advertisement
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.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Two Text Fields in a Form

  • 09-04-2015 10: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,764 ✭✭✭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,027 ✭✭✭✭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,027 ✭✭✭✭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